summaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorCamiel Dobbelaar <camield@cvs.openbsd.org>2012-10-05 17:17:05 +0000
committerCamiel Dobbelaar <camield@cvs.openbsd.org>2012-10-05 17:17:05 +0000
commit97f361f45ba615c51d5ed3d199661695056d69fd (patch)
treed587043476b3011e4b9d407ae8f76b924f697564 /sys/net/if_ethersubr.c
parentf9456dc1995e86224b952c3e98063ed528245036 (diff)
Point an interface directly to its bridgeport configuration, instead
of to the bridge itself. This is ok, since an interface can only be part of one bridge, and the parent bridge is easy to find from the bridgeport. This way we can get rid of a lot of list walks, improving performance and shortening the code. ok henning stsp sthen reyk
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 477fd7018b5..660d9210ec5 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.151 2011/07/09 00:47:18 henning Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.152 2012/10/05 17:17:04 camield Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -379,15 +379,14 @@ ether_output(ifp0, m0, dst, rt0)
#if NBRIDGE > 0
/*
- * Interfaces that are bridge members need special handling
- * for output.
+ * Interfaces that are bridgeports need special handling for output.
*/
- if (ifp->if_bridge) {
+ if (ifp->if_bridgeport) {
struct m_tag *mtag;
/*
* Check if this packet has already been sent out through
- * this bridge, in which case we simply send it out
+ * this bridgeport, in which case we simply send it out
* without further bridge processing.
*/
for (mtag = m_tag_find(m, PACKET_TAG_BRIDGE, NULL); mtag;
@@ -399,7 +398,7 @@ ether_output(ifp0, m0, dst, rt0)
goto bad;
}
#endif
- if (!bcmp(&ifp->if_bridge, mtag + 1, sizeof(caddr_t)))
+ if (!bcmp(&ifp->if_bridgeport, mtag + 1, sizeof(caddr_t)))
break;
}
if (mtag == NULL) {
@@ -410,7 +409,7 @@ ether_output(ifp0, m0, dst, rt0)
error = ENOBUFS;
goto bad;
}
- bcopy(&ifp->if_bridge, mtag + 1, sizeof(caddr_t));
+ bcopy(&ifp->if_bridgeport, mtag + 1, sizeof(caddr_t));
m_tag_prepend(m, mtag);
error = bridge_output(ifp, m, NULL, NULL);
return (error);
@@ -560,7 +559,7 @@ ether_input(ifp0, eh, m)
* NULL if it has consumed the packet, otherwise, it
* gets processed as normal.
*/
- if (ifp->if_bridge) {
+ if (ifp->if_bridgeport) {
if (m->m_flags & M_PROTO1)
m->m_flags &= ~M_PROTO1;
else {