summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-06-11 03:47:21 +0000
committerrwatson <rwatson@FreeBSD.org>2004-06-11 03:47:21 +0000
commitfe59af8e6895df4848f3dcd78d7d52fc365245e7 (patch)
treeed8c4a53642b3aa4df291ba07e419d827f8231da /sys
parent0fa5ca52c65380abf9eefde88e7944f404a629ff (diff)
downloadFreeBSD-src-fe59af8e6895df4848f3dcd78d7d52fc365245e7.zip
FreeBSD-src-fe59af8e6895df4848f3dcd78d7d52fc365245e7.tar.gz
Switch to conditionally acquiring and dropping Giant around calls into
ifp->if_output() basedd on debug.mpsafenet. That way once bpfwrite() can be called without Giant, it will acquire Giant (if desired) before entering the network stack.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/bpf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 8d01cd9..8bb0fe5 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -580,9 +580,9 @@ bpfwrite(dev, uio, ioflag)
mac_create_mbuf_from_bpfdesc(d, m);
BPFD_UNLOCK(d);
#endif
- mtx_lock(&Giant);
+ NET_LOCK_GIANT();
error = (*ifp->if_output)(ifp, m, &dst, (struct rtentry *)0);
- mtx_unlock(&Giant);
+ NET_UNLOCK_GIANT();
/*
* The driver frees the mbuf.
*/
OpenPOWER on IntegriCloud