summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2012-09-13 19:54:57 +0000
committerDavid S. Miller <davem@davemloft.net>2012-09-19 15:35:33 -0400
commit3fd91fb35847a8b3287f00970efc069de16df8b4 (patch)
tree2512b1a45c9b18b4e31bb894c8f0c1d134426b0b /net/ipv6
parentb40863c667c16b7a73d4f034a8eab67029b5b15a (diff)
downloadtalos-obmc-linux-3fd91fb35847a8b3287f00970efc069de16df8b4.tar.gz
talos-obmc-linux-3fd91fb35847a8b3287f00970efc069de16df8b4.zip
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.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,
static bool rt6_check_expired(const struct rt6_info *rt)
{
- struct rt6_info *ort = NULL;
-
if (rt->rt6i_flags & RTF_EXPIRES) {
if (time_after(jiffies, rt->dst.expires))
return true;
} else if (rt->dst.from) {
- ort = (struct rt6_info *) rt->dst.from;
- return (ort->rt6i_flags & RTF_EXPIRES) &&
- time_after(jiffies, ort->dst.expires);
+ return rt6_check_expired((struct rt6_info *) rt->dst.from);
}
return false;
}
OpenPOWER on IntegriCloud