aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Colitti2013-03-03 14:46:46 -0600
committerJP Abgrall2013-03-05 20:04:31 -0600
commita276def548828763cf5ac228adf8c1ca73f8d4d3 (patch)
tree2ddf6da8046d90d1694664db212203c5f87bd6d9
parent20f3d0b9f976b3fb24b93457737f4090f23720b1 (diff)
downloadkernel-common-a276def548828763cf5ac228adf8c1ca73f8d4d3.tar.gz
kernel-common-a276def548828763cf5ac228adf8c1ca73f8d4d3.tar.xz
kernel-common-a276def548828763cf5ac228adf8c1ca73f8d4d3.zip
net: ipv6: Don't purge default router if accept_ra=2
Setting net.ipv6.conf.<interface>.accept_ra=2 causes the kernel to accept RAs even when forwarding is enabled. However, enabling forwarding purges all default routes on the system, breaking connectivity until the next RA is received. Fix this by not purging default routes on interfaces that have accept_ra=2. Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/route.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index bbca50ae830..57ac863378e 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1886,7 +1886,8 @@ void rt6_purge_dflt_routers(struct net *net)
1886restart: 1886restart:
1887 read_lock_bh(&table->tb6_lock); 1887 read_lock_bh(&table->tb6_lock);
1888 for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) { 1888 for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) {
1889 if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) { 1889 if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF) &&
1890 (!rt->rt6i_idev || rt->rt6i_idev->cnf.accept_ra != 2)) {
1890 dst_hold(&rt->dst); 1891 dst_hold(&rt->dst);
1891 read_unlock_bh(&table->tb6_lock); 1892 read_unlock_bh(&table->tb6_lock);
1892 ip6_del_rt(rt); 1893 ip6_del_rt(rt);