[radvd-devel-l] Linux and specific routes

Arnaud Ebalard arnaud.ebalard at eads.net
Sat Dec 20 21:59:44 EST 2008


Hi,

"Teran McKinney" <sega01 at gmail.com> writes:

> Radvd has been working great for me under two installs, but I am
> having trouble with specific route autoconfiguration (though I think
> the problem is in the kernel). I am using the 2.6.27.9 Linux kernel
> and have prefixes and default routes configuring fine, but specific
> routes are not working at all.

A fix was applied by David Miller just after 2.6.27 release (commit
22441cfa0c70dcd457f3c081fcf285c3bd155824: IPV6: Fix default gateway
criteria wrt. HIGH/LOW preference radv option). I don't think it 
was passed to -stable team yet. 2.6.28 should work just fine (it should
be released next week)

> Here is my desired working config:
> interface br0	{
> AdvSendAdvert on;
> AdvDefaultLifetime 0;
> AdvHomeAgentFlag off;
> prefix fd11:2358:1321::/64 {
> 	AdvOnLink on;
> 	AdvAutonomous on;
> };
> route fd11:2358:1321::/48 {
> 		AdvRoutePreference high;
> 		AdvRouteLifetime infinity;
> };
> RDNSS fd11:2358:1321::1
> {
> 	AdvRDNSSPreference 8;
>         AdvRDNSSOpen off;
> };
> };
>
> I've tried variants of routes outside the prefix, more specific inside
> the prefix, default router enabled, and more, but can't get it to auto
> configure except for the prefix. I can verify that the route is
> showing up with rdisc6 each time. Does the Linux kernel support
> specific route configuration, or am I doing something wrong in the
> config? Do you know of a kernel patch for specific route configuration
> if the kernel doesn't support it?

I have attached the patch associated with previous commit to this email.

If you want a long term solution, you can ask the -stable team to add
the patch to the next stable kernel (2.6.27.11 or 12) now that it is in
Linus tree.  

Cheers,

a+

diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 0306744..a93a8dd 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -40,16 +40,18 @@ struct icmp6hdr {
                 struct icmpv6_nd_ra {
                        __u8            hop_limit;
 #if defined(__LITTLE_ENDIAN_BITFIELD)
-                       __u8            reserved:4,
+                       __u8            reserved:3,
                                        router_pref:2,
+                                       home_agent:1,
                                        other:1,
                                        managed:1;
 
 #elif defined(__BIG_ENDIAN_BITFIELD)
                        __u8            managed:1,
                                        other:1,
+                                       home_agent:1,
                                        router_pref:2,
-                                       reserved:4;
+                                       reserved:3;
 #else
 #error "Please fix <asm/byteorder.h>"
 #endif
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 840b157..aae7ddc 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1199,7 +1199,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
                }
                neigh->flags |= NTF_ROUTER;
        } else if (rt) {
-               rt->rt6i_flags |= (rt->rt6i_flags & ~RTF_PREF_MASK) | RTF_PREF(pref);
+               rt->rt6i_flags = (rt->rt6i_flags & ~RTF_PREF_MASK) | RTF_PREF(pref);
        }
 
        if (rt)



More information about the radvd-devel-l mailing list