summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-06-01 21:57:13 +0000
committerphk <phk@FreeBSD.org>2000-06-01 21:57:13 +0000
commit2e5551ad87228caa7a774df7bfb17c1e7bbf85a7 (patch)
tree74ca30785541f4af71bca63e0c37181e4b493692 /sys/net/bpf.c
parentb6c2abe0175678398e4004880e5059816c7e0914 (diff)
downloadFreeBSD-src-2e5551ad87228caa7a774df7bfb17c1e7bbf85a7.zip
FreeBSD-src-2e5551ad87228caa7a774df7bfb17c1e7bbf85a7.tar.gz
Don't panic if ifpromisc() returnes ENXIO, it's probably just an pccard
which have been pulled.
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r--sys/net/bpf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 6c08190..5fc8262 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -295,6 +295,7 @@ static void
bpf_detachd(d)
struct bpf_d *d;
{
+ int error;
struct bpf_d **p;
struct bpf_if *bp;
@@ -305,13 +306,17 @@ bpf_detachd(d)
*/
if (d->bd_promisc) {
d->bd_promisc = 0;
- if (ifpromisc(bp->bif_ifp, 0))
+ error = ifpromisc(bp->bif_ifp, 0);
+ if (error != 0 && error != ENXIO) {
/*
+ * ENXIO can happen if a pccard is unplugged
* Something is really wrong if we were able to put
* the driver into promiscuous mode, but can't
* take it out.
*/
- panic("bpf: ifpromisc failed");
+ printf("%s%d: ifpromisc failed %d\n",
+ bp->bif_ifp->if_name, bp->bif_ifp->if_unit, error);
+ }
}
/* Remove d from the interface's descriptor list. */
p = &bp->bif_dlist;
OpenPOWER on IntegriCloud