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.
This commit is contained in:
Robert Watson 2004-06-11 03:47:21 +00:00
parent 8240bf1e04
commit b8f9429d55

View File

@ -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.
*/