aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2013-12-18 23:40:26 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-19 18:35:21 -0500
commit24f5b855e17df7e355eacd6c4a12cc4d6a6c9ff0 (patch)
treefe53a5a19fc028aaa1714298a9e2a87730c8366d
parent7a2a84518cfb263d2c4171b3d63671f88316adb2 (diff)
ipv6: always set the new created dst's from in ip6_rt_copy
ip6_rt_copy only sets dst.from if ort has flag RTF_ADDRCONF and RTF_DEFAULT. but the prefix routes which did get installed by hand locally can have an expiration, and no any flag combination which can ensure a potential from does never expire, so we should always set the new created dst's from. This also fixes the new created dst is always expired since the ort, which is created by RA, maybe has RTF_EXPIRES and RTF_ADDRCONF, but no RTF_DEFAULT. Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org> CC: Gao feng <gaofeng@cn.fujitsu.com> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/route.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index a0a48ac3403f..4b4944c3e4c4 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1905,9 +1905,7 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,
1905 else 1905 else
1906 rt->rt6i_gateway = *dest; 1906 rt->rt6i_gateway = *dest;
1907 rt->rt6i_flags = ort->rt6i_flags; 1907 rt->rt6i_flags = ort->rt6i_flags;
1908 if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) == 1908 rt6_set_from(rt, ort);
1909 (RTF_DEFAULT | RTF_ADDRCONF))
1910 rt6_set_from(rt, ort);
1911 rt->rt6i_metric = 0; 1909 rt->rt6i_metric = 0;
1912 1910
1913#ifdef CONFIG_IPV6_SUBTREES 1911#ifdef CONFIG_IPV6_SUBTREES