summaryrefslogtreecommitdiff
path: root/sys/netinet6
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/netinet6
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/netinet6')
-rw-r--r--sys/netinet6/in6.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 1eddd037f19..338e118525e 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.99 2012/09/19 09:47:25 bluhm Exp $ */
+/* $OpenBSD: in6.c,v 1.100 2012/10/05 17:17:04 camield Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -85,6 +85,9 @@
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/if_ether.h>
+#if NBRIDGE > 0
+#include <net/if_bridge.h>
+#endif
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
@@ -1907,8 +1910,7 @@ in6_ifpprefix(const struct ifnet *ifp, const struct in6_addr *addr)
if ((rt->rt_flags & (RTF_CLONING | RTF_CLONED)) == 0 ||
(rt->rt_ifp != ifp &&
#if NBRIDGE > 0
- (rt->rt_ifp->if_bridge == NULL || ifp->if_bridge == NULL ||
- rt->rt_ifp->if_bridge != ifp->if_bridge) &&
+ !SAME_BRIDGE(rt->rt_ifp->if_bridgeport, ifp->if_bridgeport) &&
#endif
#if NCARP > 0
(ifp->if_type != IFT_CARP || rt->rt_ifp != ifp->if_carpdev) &&