aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJiri Bohac <jbohac@suse.cz>2012-04-16 03:34:39 +0000
committerDavid S. Miller <davem@davemloft.net>2012-04-17 22:31:51 -0400
commitedfb5d4687d587c9f714799c7ee27517118e12e6 (patch)
treea3f420b125f8b55bd9135ab3c9299a2b22a24507 /include
parentb95465c8fcd7c8619ff9ff7bbf8038ab31c7f34b (diff)
downloadlinux-linaro-stable-edfb5d4687d587c9f714799c7ee27517118e12e6.tar.gz
ipv6: fix rt6_update_expires
Commit 1716a961 (ipv6: fix problem with expired dst cache) broke PMTU discovery. rt6_update_expires() calls dst_set_expires(), which only updates dst->expires if it has not been set previously (expires == 0) or if the new expires is earlier than the current dst->expires. rt6_update_expires() needs to zero rt->dst.expires, otherwise it will contain ivalid data left over from rt->dst.from and will confuse dst_set_expires(). Signed-off-by: Jiri Bohac <jbohac@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip6_fib.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index c64778fd5e13..cb8da1dac512 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -143,8 +143,14 @@ static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
static inline void rt6_update_expires(struct rt6_info *rt, int timeout)
{
- if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
- dst_release(rt->dst.from);
+ if (!(rt->rt6i_flags & RTF_EXPIRES)) {
+ if (rt->dst.from)
+ dst_release(rt->dst.from);
+ /* dst_set_expires relies on expires == 0
+ * if it has not been set previously.
+ */
+ rt->dst.expires = 0;
+ }
dst_set_expires(&rt->dst, timeout);
rt->rt6i_flags |= RTF_EXPIRES;