From: YOSHIFUJI Hideaki / 吉藤英明 Date: Sun, 28 Mar 2010 07:15:45 +0000 (+0000) Subject: ipv6: Don't drop cache route entry unless timer actually expired. X-Git-Tag: Ubuntu-goldfish-3.4.0-4.27~7716^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=54c1a859efd9fd6cda05bc700315ba2519c14eba;p=mirror_ubuntu-zesty-kernel.git ipv6: Don't drop cache route entry unless timer actually expired. This is ipv6 variant of the commit 5e016cbf6.. ("ipv4: Don't drop redirected route cache entry unless PTMU actually expired") by Guenter Roeck . Remove cache route entry in ipv6_negative_advice() only if the timer is expired. Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 7fcb0e5d1213..0d7713c5c206 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -890,12 +890,17 @@ static struct dst_entry *ip6_negative_advice(struct dst_entry *dst) struct rt6_info *rt = (struct rt6_info *) dst; if (rt) { - if (rt->rt6i_flags & RTF_CACHE) - ip6_del_rt(rt); - else + if (rt->rt6i_flags & RTF_CACHE) { + if (rt6_check_expired(rt)) { + ip6_del_rt(rt); + dst = NULL; + } + } else { dst_release(dst); + dst = NULL; + } } - return NULL; + return dst; } static void ip6_link_failure(struct sk_buff *skb)