[3.8.y.z extended stable] Patch "ipv6: use rt6_get_dflt_router to get default router in rt6_route_rcv" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Wed Dec 11 20:09:27 UTC 2013


This is a note to let you know that I have just added a patch titled

    ipv6: use rt6_get_dflt_router to get default router in rt6_route_rcv

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

This patch is scheduled to be released in version 3.8.13.15.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From c405a5ac91a8b183c30974ad43d175689ee41f23 Mon Sep 17 00:00:00 2001
From: Duan Jiong <duanj.fnst at cn.fujitsu.com>
Date: Fri, 8 Nov 2013 09:56:53 +0800
Subject: ipv6: use rt6_get_dflt_router to get default router in rt6_route_rcv

[ Upstream commit f104a567e673f382b09542a8dc3500aa689957b4 ]

As the rfc 4191 said, the Router Preference and Lifetime values in a
::/0 Route Information Option should override the preference and lifetime
values in the Router Advertisement header. But when the kernel deals with
a ::/0 Route Information Option, the rt6_get_route_info() always return
NULL, that means that overriding will not happen, because those default
routers were added without flag RTF_ROUTEINFO in rt6_add_dflt_router().

In order to deal with that condition, we should call rt6_get_dflt_router
when the prefix length is 0.

Signed-off-by: Duan Jiong <duanj.fnst at cn.fujitsu.com>
Acked-by: Hannes Frederic Sowa <hannes at stressinduktion.org>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 net/ipv6/route.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c9eb8eb..abf3556 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -699,8 +699,11 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len,
 		prefix = &prefix_buf;
 	}

-	rt = rt6_get_route_info(net, prefix, rinfo->prefix_len, gwaddr,
-				dev->ifindex);
+	if (rinfo->prefix_len == 0)
+		rt = rt6_get_dflt_router(gwaddr, dev);
+	else
+		rt = rt6_get_route_info(net, prefix, rinfo->prefix_len,
+					gwaddr, dev->ifindex);

 	if (rt && !lifetime) {
 		ip6_del_rt(rt);
--
1.8.3.2





More information about the kernel-team mailing list