aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2012-09-13 15:54:57 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-19 15:35:33 -0400
commit3fd91fb35847a8b3287f00970efc069de16df8b4 (patch)
tree2512b1a45c9b18b4e31bb894c8f0c1d134426b0b
parentb40863c667c16b7a73d4f034a8eab67029b5b15a (diff)
ipv6: recursive check rt->dst.from when call rt6_check_expired
If dst cache dst_a copies from dst_b, and dst_b copies from dst_c, check if dst_a is expired or not, we should not end with dst_a->dst.from, dst_b, we should check dst_c. CC: Gao feng <gaofeng@cn.fujitsu.com> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/route.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 83dafa528936..0607ee3a0eac 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -369,15 +369,11 @@ static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev,
369 369
370static bool rt6_check_expired(const struct rt6_info *rt) 370static bool rt6_check_expired(const struct rt6_info *rt)
371{ 371{
372 struct rt6_info *ort = NULL;
373
374 if (rt->rt6i_flags & RTF_EXPIRES) { 372 if (rt->rt6i_flags & RTF_EXPIRES) {
375 if (time_after(jiffies, rt->dst.expires)) 373 if (time_after(jiffies, rt->dst.expires))
376 return true; 374 return true;
377 } else if (rt->dst.from) { 375 } else if (rt->dst.from) {
378 ort = (struct rt6_info *) rt->dst.from; 376 return rt6_check_expired((struct rt6_info *) rt->dst.from);
379 return (ort->rt6i_flags & RTF_EXPIRES) &&
380 time_after(jiffies, ort->dst.expires);
381 } 377 }
382 return false; 378 return false;
383} 379}