]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/blobdiff - net/ipv6/ip6_fib.c
netns: Add network namespace argument to rt6_fill_node() and ipv6_dev_get_saddr()
[lisovros/linux_canprio.git] / net / ipv6 / ip6_fib.c
index b3f6e03c454cc7571800fc8b06538bdb5aa4c24e..fe801716a7fc8718997a1b79eff6ec686e5aa77f 100644 (file)
@@ -380,6 +380,7 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
 
        arg.skb = skb;
        arg.cb = cb;
+       arg.net = net;
        w->args = &arg;
 
        for (h = s_h; h < FIB_TABLE_HASHSZ; h++, s_e = 0) {
@@ -663,7 +664,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
 
 static __inline__ void fib6_start_gc(struct net *net, struct rt6_info *rt)
 {
-       if (net->ipv6.ip6_fib_timer->expires == 0 &&
+       if (!timer_pending(net->ipv6.ip6_fib_timer) &&
            (rt->rt6i_flags & (RTF_EXPIRES|RTF_CACHE)))
                mod_timer(net->ipv6.ip6_fib_timer, jiffies +
                          net->ipv6.sysctl.ip6_rt_gc_interval);
@@ -671,7 +672,7 @@ static __inline__ void fib6_start_gc(struct net *net, struct rt6_info *rt)
 
 void fib6_force_start_gc(struct net *net)
 {
-       if (net->ipv6.ip6_fib_timer->expires == 0)
+       if (!timer_pending(net->ipv6.ip6_fib_timer))
                mod_timer(net->ipv6.ip6_fib_timer, jiffies +
                          net->ipv6.sysctl.ip6_rt_gc_interval);
 }
@@ -772,6 +773,10 @@ out:
                 * If fib6_add_1 has cleared the old leaf pointer in the
                 * super-tree leaf node we have to find a new one for it.
                 */
+               if (pn != fn && pn->leaf == rt) {
+                       pn->leaf = NULL;
+                       atomic_dec(&rt->rt6i_ref);
+               }
                if (pn != fn && !pn->leaf && !(pn->fn_flags & RTN_RTINFO)) {
                        pn->leaf = fib6_find_prefix(info->nl_net, pn);
 #if RT6_DEBUG >= 2
@@ -1539,7 +1544,7 @@ out_timer:
 static void fib6_net_exit(struct net *net)
 {
        rt6_ifdown(net, NULL);
-       del_timer(net->ipv6.ip6_fib_timer);
+       del_timer_sync(net->ipv6.ip6_fib_timer);
        kfree(net->ipv6.ip6_fib_timer);
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
        kfree(net->ipv6.fib6_local_tbl);