diff options
author | mpi <mpi@openbsd.org> | 2019-04-28 22:15:57 +0000 |
---|---|---|
committer | mpi <mpi@openbsd.org> | 2019-04-28 22:15:57 +0000 |
commit | 96c4247ccbf78c38f00780e28567a99a63d7bf42 (patch) | |
tree | 79d5e244376310b8fa18e3191a7ee50f295e17de /sys/net/if.c | |
parent | Support multiple occurances of the same argument. Use this for a new (diff) | |
download | wireguard-openbsd-96c4247ccbf78c38f00780e28567a99a63d7bf42.tar.xz wireguard-openbsd-96c4247ccbf78c38f00780e28567a99a63d7bf42.zip |
Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.
This redefines the ifp <-> bridge relationship. No lock can be
currently used across the multiples contexts where the bridge has
tentacles to protect a pointer, use an interface index.
Tested by various, ok dlg@, visa@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 9285372af00..8b7d7075cdf 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.580 2019/04/22 03:26:16 dlg Exp $ */ +/* $OpenBSD: if.c,v 1.581 2019/04/28 22:15:57 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -695,12 +695,10 @@ if_enqueue(struct ifnet *ifp, struct mbuf *m) #endif #if NBRIDGE > 0 - if (ifp->if_bridgeport && (m->m_flags & M_PROTO1) == 0) { + if (ifp->if_bridgeidx && (m->m_flags & M_PROTO1) == 0) { int error; - KERNEL_LOCK(); - error = bridge_output(ifp, m, NULL, NULL); - KERNEL_UNLOCK(); + error = bridge_enqueue(ifp, m); return (error); } #endif @@ -1194,7 +1192,7 @@ if_isconnected(const struct ifnet *ifp0, unsigned int ifidx) connected = 1; #if NBRIDGE > 0 - if (SAME_BRIDGE(ifp0->if_bridgeport, ifp->if_bridgeport)) + if (ifp0->if_bridgeidx == ifp->if_bridgeidx) connected = 1; #endif #if NCARP > 0 |