diff options
author | 2018-07-13 08:51:15 +0000 | |
---|---|---|
committer | 2018-07-13 08:51:15 +0000 | |
commit | 273c5eebb1898b077ab2647196c09b22ebfed46e (patch) | |
tree | b0cd545956d0670494bcb71be4da611bedd033cb | |
parent | Unused variables. (diff) | |
download | wireguard-openbsd-273c5eebb1898b077ab2647196c09b22ebfed46e.tar.xz wireguard-openbsd-273c5eebb1898b077ab2647196c09b22ebfed46e.zip |
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@
-rw-r--r-- | sys/net/bpf.c | 5 |
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 |