diff options
author | mpi <mpi@openbsd.org> | 2018-10-01 12:38:32 +0000 |
---|---|---|
committer | mpi <mpi@openbsd.org> | 2018-10-01 12:38:32 +0000 |
commit | 1145e5f3850528b347477ef786f792140744e0e9 (patch) | |
tree | 453e8f0f981728365b348f2c15d2b93a4898b6d3 /sys/net/if.c | |
parent | regen (diff) | |
download | wireguard-openbsd-1145e5f3850528b347477ef786f792140744e0e9.tar.xz wireguard-openbsd-1145e5f3850528b347477ef786f792140744e0e9.zip |
Put bridge_input & output back under the KERNEL_LOCK().
Wireless drivers call if_enqueue() out of the NET_LOCK() so it cannot
be used to serialize bridge(4) states.
Found by stsp@, ok visa@
Diffstat (limited to 'sys/net/if.c')
-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 98063c8862c..d0da7c41b3c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.565 2018/09/26 11:50:42 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.566 2018/10/01 12:38:32 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -692,8 +692,12 @@ if_enqueue(struct ifnet *ifp, struct mbuf *m) #endif #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 #if NPF > 0 |