Patchwork Linux IPV6_SUBTREES not functioning

login
register
mail settings
Submitter Hannes Frederic Sowa
Date Aug. 6, 2013, 11:43 a.m.
Message ID <20130806114327.GA11767@order.stressinduktion.org>
Download mbox | patch
Permalink /patch/265039/
State RFC
Delegated to: David Miller
Headers show

Comments

Hannes Frederic Sowa - Aug. 6, 2013, 11:43 a.m.
On Tue, Aug 06, 2013 at 10:53:07AM +0200, Hannes Frederic Sowa wrote:
> On Tue, Aug 06, 2013 at 10:46:43AM +0200, Teco Boot wrote:
> > Hi Hannes,
> > 
> > Yes problems with real traffic, with CORE (open source mobile ad hoc network emulator currently maintained by NRL and Boeing).
> > Mattieu had same problems and therefore stepped to the ip rule. Most, if not all, take this ip rule hack. But then, for each and every source prefix a complete routing table is needed. This is a bad thing and shall be avoided.
> > 
> > Do you think it should work? Have it working? If so, I want to reproduce.
> 
> Definitely, that should work. I can reproduce the same output with your
> script on net-next and am looking how to fix this. This could take a
> bit because I have another patch in my pipeline for testing. But maybe
> it is just a nit. ;)

Could you test if this patch fixes your problems? It does fix the output of
your script at least. ;)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index ed828d6..2eaf4a8 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -993,8 +993,12 @@  static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
 
 			if (ipv6_prefix_equal(&key->addr, args->addr, key->plen)) {
 #ifdef CONFIG_IPV6_SUBTREES
-				if (fn->subtree)
-					fn = fib6_lookup_1(fn->subtree, args + 1);
+				if (fn->subtree) {
+					struct fib6_node *sfn;
+					sfn = fib6_lookup_1(fn->subtree,
+							    args + 1);
+					fn = sfn ? : fn;
+				}
 #endif
 				if (!fn || fn->fn_flags & RTN_RTINFO)
 					return fn;