From 6bf66bc7113c30b524ae96ef78ccedf99ead7bd2 Mon Sep 17 00:00:00 2001 From: Harshavardhan Nalajala Date: Thu, 23 Oct 2014 17:00:31 -0700 Subject: [PATCH] Add missing default route changes Default route changes were missing as part of dbed723911c6ce4c1b9b3d3b8a9ac7ed681b646a. So, ipv6 global address acquisition fails most of times. Adding the missing default route changes resolved the issue. Bug 1568030 Change-Id: Ida443281757e6feb3c35e1a7744cba6465e23bb9 Signed-off-by: Harshavardhan Nalajala Reviewed-on: http://git-master/r/562657 Reviewed-by: Dhiren Parmar Tested-by: Dhiren Parmar --- net/ipv6/route.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1ce5f616e95..3e3fc446d4d 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -725,7 +725,10 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, prefix = &prefix_buf; } - rt = rt6_get_route_info(dev, prefix, rinfo->prefix_len, gwaddr); + if (rinfo->prefix_len == 0) + rt = rt6_get_dflt_router(gwaddr, dev); + else + rt = rt6_get_route_info(dev, prefix, rinfo->prefix_len, gwaddr); if (rt && !lifetime) { ip6_del_rt(rt); @@ -1884,7 +1887,7 @@ static struct rt6_info *rt6_add_route_info(struct net_device *dev, struct fib6_config cfg = { .fc_table = addrconf_rt_table(dev, RT6_TABLE_INFO), .fc_metric = IP6_RT_PRIO_USER, - .fc_ifindex = ifindex, + .fc_ifindex = dev->ifindex, .fc_dst_len = prefixlen, .fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO | RTF_UP | RTF_PREF(pref), @@ -1934,7 +1937,7 @@ struct rt6_info *rt6_add_dflt_router(const struct in6_addr *gwaddr, unsigned int pref) { struct fib6_config cfg = { - .fc_table = RT6_TABLE_DFLT, + .fc_table = addrconf_rt_table(dev, RT6_TABLE_DFLT), .fc_metric = IP6_RT_PRIO_USER, .fc_ifindex = dev->ifindex, .fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT | -- 2.39.2