diff mbox

[net-next] ipv6: recursive check rt->dst.from when call rt6_check_expired

Message ID 1347602097-18034-1-git-send-email-roy.qing.li@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Li RongQing Sept. 14, 2012, 5:54 a.m. UTC
From: Li RongQing <roy.qing.li@gmail.com>

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>
---
 net/ipv6/route.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

Comments

Gao feng Sept. 19, 2012, 8:22 a.m. UTC | #1
于 2012年09月14日 13:54, roy.qing.li@gmail.com 写道:
> From: Li RongQing <roy.qing.li@gmail.com>
> 
> 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>
> ---

Looks good to me,thanks rongqing :)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 19, 2012, 5:41 p.m. UTC | #2
From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Wed, 19 Sep 2012 16:22:22 +0800

> 于 2012年09月14日 13:54, roy.qing.li@gmail.com 写道:
>> From: Li RongQing <roy.qing.li@gmail.com>
>> 
>> 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>
>> ---
> 
> Looks good to me,thanks rongqing :)

An explicit "Acked-by: " is more useful to us than simply saying
it looks good.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 19, 2012, 7:35 p.m. UTC | #3
From: roy.qing.li@gmail.com
Date: Fri, 14 Sep 2012 13:54:57 +0800

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> 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>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 83dafa5..0607ee3 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;
 }