summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2015-04-02 09:46:01 +0000
committerkettenis <kettenis@openbsd.org>2015-04-02 09:46:01 +0000
commit6915b02bd28ba41df711ab41a0b2802c48060787 (patch)
tree3a3cada49880b66f93ab47dc5cb3f78f4aa24cd7
parentCorrect man page title. (diff)
downloadwireguard-openbsd-6915b02bd28ba41df711ab41a0b2802c48060787.tar.xz
wireguard-openbsd-6915b02bd28ba41df711ab41a0b2802c48060787.zip
Grab the kernel lock around the bpf_mtap_ether() call in if_input(). This
allows drivers to start calling if_input() without holding the kernel lock while others work on make the bpf code mpsafe. ok dlg@, mpi@
-rw-r--r--sys/net/if.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 06851a75445..bdf7cb41303 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.325 2015/04/01 04:00:55 dlg Exp $ */
+/* $OpenBSD: if.c,v 1.326 2015/04/02 09:46:01 kettenis Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -457,8 +457,10 @@ if_input(struct ifnet *ifp, struct mbuf_list *ml)
#if NBPFILTER > 0
if (ifp->if_bpf) {
+ KERNEL_LOCK();
MBUF_LIST_FOREACH(ml, m)
bpf_mtap_ether(ifp->if_bpf, m, BPF_DIRECTION_IN);
+ KERNEL_UNLOCK();
}
#endif