aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2012-07-10 00:45:50 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-17 01:55:54 -0400
commitf0396f60d7c165018c9b203fb9b89fb224835578 (patch)
tree8406b006f177e6d134a96c8c7771f1b36551995a /net/ipv6/route.c
parent1ce09e899d2864b4c8ed8f777c396bcb953aa3c9 (diff)
ipv6: fix RTPROT_RA markup of RA routes w/nexthops
Userspace implementations of network routing protocols sometimes need to tell RA-originated IPv6 routes from other kernel routes to make proper routing decisions. This makes most sense for RA routes with nexthops, namely, default routes and Route Information routes. The intended mean of preserving RA route origin in a netlink message is through indicating RTPROT_RA as protocol code. Function rt6_fill_node() tried to do that for default routes, but its test condition was taken wrong. This change is modeled after the original mailing list posting by Jeff Haran. It fixes the test condition for default route case and sets the same behaviour for Route Information case (both types use nexthops). Handling of the 3rd RA route type, Prefix Information, is left unchanged, as it stands for interface connected routes (without nexthops). Signed-off-by: Denis Ovsienko <infrastation@yandex.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 2a4c8d48977f..412fad809a3b 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2399,10 +2399,12 @@ static int rt6_fill_node(struct net *net,
2399 rtm->rtm_protocol = rt->rt6i_protocol; 2399 rtm->rtm_protocol = rt->rt6i_protocol;
2400 if (rt->rt6i_flags & RTF_DYNAMIC) 2400 if (rt->rt6i_flags & RTF_DYNAMIC)
2401 rtm->rtm_protocol = RTPROT_REDIRECT; 2401 rtm->rtm_protocol = RTPROT_REDIRECT;
2402 else if (rt->rt6i_flags & RTF_ADDRCONF) 2402 else if (rt->rt6i_flags & RTF_ADDRCONF) {
2403 rtm->rtm_protocol = RTPROT_KERNEL; 2403 if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ROUTEINFO))
2404 else if (rt->rt6i_flags & RTF_DEFAULT) 2404 rtm->rtm_protocol = RTPROT_RA;
2405 rtm->rtm_protocol = RTPROT_RA; 2405 else
2406 rtm->rtm_protocol = RTPROT_KERNEL;
2407 }
2406 2408
2407 if (rt->rt6i_flags & RTF_CACHE) 2409 if (rt->rt6i_flags & RTF_CACHE)
2408 rtm->rtm_flags |= RTM_F_CLONED; 2410 rtm->rtm_flags |= RTM_F_CLONED;