diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-04-28 22:15:59 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-04-28 22:15:59 +0000 |
commit | 18fddbc0ffa78e2efee3b7db27bfe5c5f8c46545 (patch) | |
tree | 62f22d322f0aa70d58dfb4b7448324845a27e611 /sys/net/bridgestp.c | |
parent | 33d544b49816a3e9c53b23a441cbbb44ca3e7104 (diff) |
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/bridgestp.c')
-rw-r--r-- | sys/net/bridgestp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 2fb0370e55f..3c8081cbdec 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bridgestp.c,v 1.68 2019/03/31 13:56:25 mpi Exp $ */ +/* $OpenBSD: bridgestp.c,v 1.69 2019/04/28 22:15:57 mpi Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -1616,7 +1616,7 @@ bstp_ifstate(void *arg) return; s = splnet(); - if ((bif = (struct bridge_iflist *)ifp->if_bridgeport) == NULL) + if ((bif = bridge_getbif(ifp)) == NULL) goto done; if ((bif->bif_flags & IFBIF_STP) == 0) goto done; @@ -2092,8 +2092,7 @@ bstp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) err = ENOENT; break; } - bif = (struct bridge_iflist *)ifs->if_bridgeport; - if (bif == NULL || bif->bridge_sc != sc) { + if (ifs->if_bridgeidx != ifp->if_index) { err = ESRCH; break; } |