diff options
-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; |