summaryrefslogtreecommitdiffstats
path: root/include/net/ip6_fib.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-04-23 23:14:36 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-23 23:15:17 -0400
commitf24001941c99776f41bd3f09c07d91205c2ad9d4 (patch)
tree0ab31480ccdf343b61db045e195d096068ef7c73 /include/net/ip6_fib.h
parenta108d5f35adc5c5d5cdc882dc0bb920565551bff (diff)
parent4d634ca35a8b38530b134ae92bc9e3cc9c23c030 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Fix merge between commit 3adadc08cc1e ("net ax25: Reorder ax25_exit to remove races") and commit 0ca7a4c87d27 ("net ax25: Simplify and cleanup the ax25 sysctl handling") The former moved around the sysctl register/unregister calls, the later simply removed them. With help from Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip6_fib.h')
-rw-r--r--include/net/ip6_fib.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index c64778fd5e1..0ae759a6c76 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -129,7 +129,7 @@ static inline void rt6_clean_expires(struct rt6_info *rt)
dst_release(rt->dst.from);
rt->rt6i_flags &= ~RTF_EXPIRES;
- rt->dst.expires = 0;
+ rt->dst.from = NULL;
}
static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
@@ -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;