diff options
author | 2015-12-04 11:50:01 +0000 | |
---|---|---|
committer | 2015-12-04 11:50:01 +0000 | |
commit | b816be0fe584c4847ac44a624ec816285bf22a8b (patch) | |
tree | e5dd739e716687bf79ecd39bcede302db3d65158 | |
parent | There is no need to grab the KERNEL_LOCK here anymore. After discussion with (diff) | |
download | wireguard-openbsd-b816be0fe584c4847ac44a624ec816285bf22a8b.tar.xz wireguard-openbsd-b816be0fe584c4847ac44a624ec816285bf22a8b.zip |
Grab the KERNEL_LOCK() around bridge_output().
It is now safe to call if_enqueue() without holding the KERNEL_LOCK()
even on an interface part of a bridge(4).
ok dlg@, henning@, kettenis@
-rw-r--r-- | sys/net/if.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 249c22e25b9..8921b864b89 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.420 2015/12/03 16:27:32 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.421 2015/12/04 11:50:01 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -626,8 +626,12 @@ if_enqueue(struct ifnet *ifp, struct mbuf *m) unsigned short mflags; #if NBRIDGE > 0 - if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0) - return (bridge_output(ifp, m, NULL, NULL)); + if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0) { + KERNEL_LOCK(); + error = bridge_output(ifp, m, NULL, NULL); + KERNEL_UNLOCK(); + return (error); + } #endif length = m->m_pkthdr.len; |