summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-10-06 04:25:37 +0000
committergreen <green@FreeBSD.org>2004-10-06 04:25:37 +0000
commita146714a1144dbc32f15982ecd5e64258f57bfee (patch)
treec6923ee4865356cce9d6137cf32980f0c0220fd9 /sys/net
parent7871c65cf0044274ba81789ed65bf64e0f47112a (diff)
downloadFreeBSD-src-a146714a1144dbc32f15982ecd5e64258f57bfee.zip
FreeBSD-src-a146714a1144dbc32f15982ecd5e64258f57bfee.tar.gz
Don't recurse the BPF descriptor lock during the BIOCSDLT operation
(and panic). To try to finish making BPF safe, at the very least, the BPF descriptor lock really needs to change into a reader/writer lock that controls access to "settings," and a mutex that controls access to the selinfo/knote/callout. Also, use of callout_drain() instead of callout_stop() (which is really a much more widespread issue).
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index bfe8a91..118d266 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1558,10 +1558,10 @@ bpf_setdlt(d, dlt)
}
mtx_unlock(&bpf_mtx);
if (bp != NULL) {
- BPFD_LOCK(d);
opromisc = d->bd_promisc;
bpf_detachd(d);
bpf_attachd(d, bp);
+ BPFD_LOCK(d);
reset_d(d);
BPFD_UNLOCK(d);
if (opromisc) {
OpenPOWER on IntegriCloud