Skip to content

Commit 54c1a85

Browse files
yoshfujidavem330
authored andcommitted
ipv6: Don't drop cache route entry unless timer actually expired.
This is ipv6 variant of the commit 5e016cb.. ("ipv4: Don't drop redirected route cache entry unless PTMU actually expired") by Guenter Roeck <[email protected]>. Remove cache route entry in ipv6_negative_advice() only if the timer is expired. Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7855f76 commit 54c1a85

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

net/ipv6/route.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,12 +890,17 @@ static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)
890890
struct rt6_info *rt = (struct rt6_info *) dst;
891891

892892
if (rt) {
893-
if (rt->rt6i_flags & RTF_CACHE)
894-
ip6_del_rt(rt);
895-
else
893+
if (rt->rt6i_flags & RTF_CACHE) {
894+
if (rt6_check_expired(rt)) {
895+
ip6_del_rt(rt);
896+
dst = NULL;
897+
}
898+
} else {
896899
dst_release(dst);
900+
dst = NULL;
901+
}
897902
}
898-
return NULL;
903+
return dst;
899904
}
900905

901906
static void ip6_link_failure(struct sk_buff *skb)

0 commit comments

Comments
 (0)