summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-07-13 08:51:16 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-07-13 08:51:16 +0000
commit83ef6899b20e2eb3021321ba5ba88986e98e959d (patch)
treecfc23ad3f410a33b79d47f29034586718a927489 /sys
parentcda7592a75033d2916b80d3660e0a753643bb628 (diff)
Some USB network interfaces like rum(4) report ENXIO from their
ioctl function after the device has been pulled out. Also accept this error code in bpf_detachd() to prevent a kernel panic. tcpdump(8) may run while the interface is detached. from Moritz Buhl; OK stsp@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/bpf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index a6bcf31d471..d3cffa592c9 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.169 2018/03/02 16:57:41 bluhm Exp $ */
+/* $OpenBSD: bpf.c,v 1.170 2018/07/13 08:51:15 bluhm Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -332,7 +332,8 @@ bpf_detachd(struct bpf_d *d)
mtx_enter(&d->bd_mtx);
bpf_put(d);
- if (error && !(error == EINVAL || error == ENODEV))
+ if (error && !(error == EINVAL || error == ENODEV ||
+ error == ENXIO))
/*
* Something is really wrong if we were able to put
* the driver into promiscuous mode, but can't