Merge branch 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro...
[firefly-linux-kernel-4.4.55.git] / include / net / ip6_fib.h
index fdc48a94a063ae8ce746c501a477ab3471ab028e..2a601e7da1bfc8b97490075531975dcdfebc8370 100644 (file)
@@ -89,8 +89,6 @@ struct fib6_table;
 struct rt6_info {
        struct dst_entry                dst;
 
-       struct neighbour                *n;
-
        /*
         * Tail elements of dst_entry (__refcnt etc.)
         * and these elements (rarely used in hot path) are in
@@ -166,50 +164,35 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
 
 static inline void rt6_clean_expires(struct rt6_info *rt)
 {
-       if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
-               dst_release(rt->dst.from);
-
        rt->rt6i_flags &= ~RTF_EXPIRES;
-       rt->dst.from = NULL;
 }
 
 static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
 {
-       if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
-               dst_release(rt->dst.from);
-
-       rt->rt6i_flags |= RTF_EXPIRES;
        rt->dst.expires = expires;
+       rt->rt6i_flags |= RTF_EXPIRES;
 }
 
-static inline void rt6_update_expires(struct rt6_info *rt, int timeout)
+static inline void rt6_update_expires(struct rt6_info *rt0, int timeout)
 {
-       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;
+       struct rt6_info *rt;
+
+       for (rt = rt0; rt && !(rt->rt6i_flags & RTF_EXPIRES);
+            rt = (struct rt6_info *)rt->dst.from);
+       if (rt && rt != rt0)
+               rt0->dst.expires = rt->dst.expires;
+
+       dst_set_expires(&rt0->dst, timeout);
+       rt0->rt6i_flags |= RTF_EXPIRES;
 }
 
 static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from)
 {
        struct dst_entry *new = (struct dst_entry *) from;
 
-       if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) {
-               if (new == rt->dst.from)
-                       return;
-               dst_release(rt->dst.from);
-       }
-
        rt->rt6i_flags &= ~RTF_EXPIRES;
-       rt->dst.from = new;
        dst_hold(new);
+       rt->dst.from = new;
 }
 
 static inline void ip6_rt_put(struct rt6_info *rt)