diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2012-09-13 15:54:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-19 15:35:33 -0400 |
commit | 3fd91fb35847a8b3287f00970efc069de16df8b4 (patch) | |
tree | 2512b1a45c9b18b4e31bb894c8f0c1d134426b0b /net/ipv6 | |
parent | b40863c667c16b7a73d4f034a8eab67029b5b15a (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>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/route.c | 6 |
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 | ||
370 | static bool rt6_check_expired(const struct rt6_info *rt) | 370 | static 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 | } |