]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IPV6] ROUTE: Purge clones on other trees when deleting a route.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Thu, 24 Aug 2006 00:22:55 +0000 (17:22 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 21:55:53 +0000 (14:55 -0700)
Based on MIPL2 kernel patch.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Ville Nuorvala <vnuorval@tcs.hut.fi
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_fib.c

index 6536e33d8353c1759437e5d520c809414613a794..f0fdaf182b3f31b7ebb17d003ceec0e4ac39c326 100644 (file)
@@ -1169,8 +1169,18 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)
 
        BUG_TRAP(fn->fn_flags&RTN_RTINFO);
 
-       if (!(rt->rt6i_flags&RTF_CACHE))
-               fib6_prune_clones(fn, rt);
+       if (!(rt->rt6i_flags&RTF_CACHE)) {
+               struct fib6_node *pn = fn;
+#ifdef CONFIG_IPV6_SUBTREES
+               /* clones of this route might be in another subtree */
+               if (rt->rt6i_src.plen) {
+                       while (!(pn->fn_flags&RTN_ROOT))
+                               pn = pn->parent;
+                       pn = pn->parent;
+               }
+#endif
+               fib6_prune_clones(pn, rt);
+       }
 
        /*
         *      Walk the leaf entries looking for ourself