netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux IPV6_SUBTREES not functioning
@ 2013-08-02 10:15 Teco Boot
  2013-08-06  8:30 ` Hannes Frederic Sowa
  0 siblings, 1 reply; 5+ messages in thread
From: Teco Boot @ 2013-08-02 10:15 UTC (permalink / raw)
  To: netdev; +Cc: boutier

For destination & source address routing, I prefer the single routing table approach with IPV6_SUBTREES over the multiple tables with ip rules approach.
Can some take a look at my findings? It looks broken. It seems the source address check in route cache is missing.

Teco


Output:
==========
this is my system:
Linux ubuntu 3.8.0-25-generic #37-Ubuntu SMP Thu Jun 6 20:47:30 UTC 2013 i686 i686 i686 GNU/Linux
CONFIG_IPV6_SUBTREES=y
... clean up for our experiment
... add a link-local
... add default
... add some source address specific defaults
====> now I have this routing table
default from 2001:db8:10::/48 via fe80::10 dev eth0  metric 1024 
default from 2001:db8:11::/48 via fe80::11 dev eth0  metric 1024 
default from 2001:db8:12::/48 via fe80::12 dev eth0  metric 1024 
fe80::1 dev eth0  proto kernel  metric 256 
default via fe80::ff dev eth0  metric 1024 
====> show route to same destination
2001:db8:babe::1 from 2001:db8:10::1 via fe80::10 dev eth0  metric 0 \    cache 
2001:db8:babe::1 from 2001:db8:11::1 via fe80::ff dev eth0  metric 0 \    cache 
2001:db8:babe::1 from 2001:db8:12::1 via fe80::ff dev eth0  metric 0 \    cache 
2001:db8:babe::1 from 2001:db8:1::1 via fe80::ff dev eth0  metric 0 \    cache 
2001:db8:babe::1 from :: via fe80::ff dev eth0  metric 0 \    cache 
====> show route to different destinations
2001:db8:cafe::10 from 2001:db8:10::1 via fe80::10 dev eth0  metric 0 \    cache 
2001:db8:cafe::11 from 2001:db8:11::1 via fe80::11 dev eth0  metric 0 \    cache 
2001:db8:cafe::12 from 2001:db8:12::1 via fe80::12 dev eth0  metric 0 \    cache 
2001:db8:cafe::21 from 2001:db8:1::1 via fe80::ff dev eth0  metric 0 \    cache 
2001:db8:cafe::22 from :: via fe80::ff dev eth0  metric 0 \    cache 
====> now the route cache is
2001:db8:babe::1 from 2001:db8:10::/48 via fe80::10 dev eth0  metric 0 \    cache 
2001:db8:babe::1 via fe80::ff dev eth0  metric 0 \    cache 
2001:db8:cafe::10 from 2001:db8:10::/48 via fe80::10 dev eth0  metric 0 \    cache 
2001:db8:cafe::11 from 2001:db8:11::/48 via fe80::11 dev eth0  metric 0 \    cache 
2001:db8:cafe::12 from 2001:db8:12::/48 via fe80::12 dev eth0  metric 0 \    cache 
2001:db8:cafe::21 via fe80::ff dev eth0  metric 0 \    cache 
2001:db8:cafe::22 via fe80::ff dev eth0  metric 0 \    cache 
 


My script:
=======
#!/bin/sh

echo "this is my system:" 
uname -a
grep IPV6_SUBTREES /boot/config-3.8.0-25-generic

echo ... clean up for our experiment
ip -6 address flush dev eth0
ip -6 route flush table all

echo ... add a link-local
ip address add fe80::1 dev eth0

echo ... add default
ip -6 route add default via fe80::ff dev eth0

echo ... add some source address specific defaults
ip -6 route add default from 2001:db8:10::/48 via fe80::10 dev eth0
ip -6 route add default from 2001:db8:11::/48 via fe80::11 dev eth0
ip -6 route add default from 2001:db8:12::/48 via fe80::12 dev eth0

echo -n "====> "
echo now I have this routing table
ip -6 -o route show table main

echo -n "====> "
echo show route to same destination
ip -6 -o route get 2001:db8:babe::1 from 2001:db8:10::1
ip -6 -o route get 2001:db8:babe::1 from 2001:db8:11::1
ip -6 -o route get 2001:db8:babe::1 from 2001:db8:12::1
ip -6 -o route get 2001:db8:babe::1 from 2001:db8:1::1
ip -6 -o route get 2001:db8:babe::1

echo -n "====> "
echo show route to different destinations
ip -6 -o route get 2001:db8:cafe::10 from 2001:db8:10::1
ip -6 -o route get 2001:db8:cafe::11 from 2001:db8:11::1
ip -6 -o route get 2001:db8:cafe::12 from 2001:db8:12::1
ip -6 -o route get 2001:db8:cafe::21 from 2001:db8:1::1
ip -6 -o route get 2001:db8:cafe::22
echo -n "====> "
echo now the route cache is
ip -6 -o route show cache

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux IPV6_SUBTREES not functioning
  2013-08-02 10:15 Linux IPV6_SUBTREES not functioning Teco Boot
@ 2013-08-06  8:30 ` Hannes Frederic Sowa
  2013-08-06  8:46   ` Teco Boot
  0 siblings, 1 reply; 5+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-06  8:30 UTC (permalink / raw)
  To: Teco Boot; +Cc: netdev, boutier

Hi!

On Fri, Aug 02, 2013 at 12:15:03PM +0200, Teco Boot wrote:
> For destination & source address routing, I prefer the single routing table approach with IPV6_SUBTREES over the multiple tables with ip rules approach.
> Can some take a look at my findings? It looks broken. It seems the source address check in route cache is missing.

Have you verified this behaviour with actual network traffic?

Greetings,

  Hannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux IPV6_SUBTREES not functioning
  2013-08-06  8:30 ` Hannes Frederic Sowa
@ 2013-08-06  8:46   ` Teco Boot
  2013-08-06  8:53     ` Hannes Frederic Sowa
  0 siblings, 1 reply; 5+ messages in thread
From: Teco Boot @ 2013-08-06  8:46 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: netdev, boutier

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.

Thanks, Teco

Op 6 aug. 2013, om 10:30 heeft Hannes Frederic Sowa <hannes@stressinduktion.org> het volgende geschreven:

> Hi!
> 
> On Fri, Aug 02, 2013 at 12:15:03PM +0200, Teco Boot wrote:
>> For destination & source address routing, I prefer the single routing table approach with IPV6_SUBTREES over the multiple tables with ip rules approach.
>> Can some take a look at my findings? It looks broken. It seems the source address check in route cache is missing.
> 
> Have you verified this behaviour with actual network traffic?
> 
> Greetings,
> 
>  Hannes
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux IPV6_SUBTREES not functioning
  2013-08-06  8:46   ` Teco Boot
@ 2013-08-06  8:53     ` Hannes Frederic Sowa
  2013-08-06 11:43       ` Hannes Frederic Sowa
  0 siblings, 1 reply; 5+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-06  8:53 UTC (permalink / raw)
  To: Teco Boot; +Cc: netdev, boutier

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. ;)

Thanks,

  Hannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux IPV6_SUBTREES not functioning
  2013-08-06  8:53     ` Hannes Frederic Sowa
@ 2013-08-06 11:43       ` Hannes Frederic Sowa
  0 siblings, 0 replies; 5+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-06 11:43 UTC (permalink / raw)
  To: Teco Boot, netdev, boutier

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. ;)

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;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-06 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-02 10:15 Linux IPV6_SUBTREES not functioning Teco Boot
2013-08-06  8:30 ` Hannes Frederic Sowa
2013-08-06  8:46   ` Teco Boot
2013-08-06  8:53     ` Hannes Frederic Sowa
2013-08-06 11:43       ` Hannes Frederic Sowa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).