]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
ipv6: recursive check rt->dst.from when call rt6_check_expired
authorLi RongQing <roy.qing.li@gmail.com>
Thu, 13 Sep 2012 19:54:57 +0000 (19:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Sep 2012 19:35:33 +0000 (15:35 -0400)
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>
net/ipv6/route.c

index 83dafa52893606cd7e56b107804f384af0eef2ce..0607ee3a0eac889b9efe2e03120755c3afdaeeb0 100644 (file)
@@ -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;
 }