diff options
author | Jiri Bohac <jbohac@suse.cz> | 2012-04-15 23:34:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-17 22:31:51 -0400 |
commit | edfb5d4687d587c9f714799c7ee27517118e12e6 (patch) | |
tree | a3f420b125f8b55bd9135ab3c9299a2b22a24507 | |
parent | b95465c8fcd7c8619ff9ff7bbf8038ab31c7f34b (diff) |
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>
-rw-r--r-- | include/net/ip6_fib.h | 10 |
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) | |||
143 | 143 | ||
144 | static inline void rt6_update_expires(struct rt6_info *rt, int timeout) | 144 | static inline void rt6_update_expires(struct rt6_info *rt, int timeout) |
145 | { | 145 | { |
146 | if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) | 146 | if (!(rt->rt6i_flags & RTF_EXPIRES)) { |
147 | dst_release(rt->dst.from); | 147 | if (rt->dst.from) |
148 | dst_release(rt->dst.from); | ||
149 | /* dst_set_expires relies on expires == 0 | ||
150 | * if it has not been set previously. | ||
151 | */ | ||
152 | rt->dst.expires = 0; | ||
153 | } | ||
148 | 154 | ||
149 | dst_set_expires(&rt->dst, timeout); | 155 | dst_set_expires(&rt->dst, timeout); |
150 | rt->rt6i_flags |= RTF_EXPIRES; | 156 | rt->rt6i_flags |= RTF_EXPIRES; |