summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-12-04 11:50:02 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-12-04 11:50:02 +0000
commitbb060720a4c20da6d77c138ac85e0ad2e6bf5659 (patch)
treeee9d799314a638d0906c4f977b0ff266405c5ed7 /sys/net/if.c
parentac3e5cf657a2dd2fbfcc6d719e383bdcead54c4a (diff)
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@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c10
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;