From 97f361f45ba615c51d5ed3d199661695056d69fd Mon Sep 17 00:00:00 2001 From: Camiel Dobbelaar Date: Fri, 5 Oct 2012 17:17:05 +0000 Subject: 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 --- sys/netinet6/in6.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/netinet6') 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 #include #include +#if NBRIDGE > 0 +#include +#endif #include #include @@ -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) && -- cgit v1.2.3