From 081d19aecd6e2788d5477fcb71fba94b9638d1eb Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 19 Mar 2000 05:46:50 +0000 Subject: [PATCH] Modify if_wi.c to call bpfdetach(ifp) before if_detach(ifp), so as to prevent a page fault if the card is ejected while BPF is in use. This could happen if DHCP or tcpdump was in use on that interface during ejection. Other drivers may also require this modification. Reviewed by: wes --- sys/dev/wi/if_wi.c | 2 ++ sys/i386/isa/if_wi.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index e678b021d7e0..a75353ebae3b 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -214,6 +214,8 @@ static int wi_pccard_detach(dev) } wi_stop(sc); + + bpfdetach(ifp); if_detach(ifp); bus_teardown_intr(dev, sc->irq, sc->wi_intrhand); wi_free(dev); diff --git a/sys/i386/isa/if_wi.c b/sys/i386/isa/if_wi.c index e678b021d7e0..a75353ebae3b 100644 --- a/sys/i386/isa/if_wi.c +++ b/sys/i386/isa/if_wi.c @@ -214,6 +214,8 @@ static int wi_pccard_detach(dev) } wi_stop(sc); + + bpfdetach(ifp); if_detach(ifp); bus_teardown_intr(dev, sc->irq, sc->wi_intrhand); wi_free(dev);