From: YOSHIFUJI Hideaki Date: Thu, 24 Aug 2006 00:22:55 +0000 (-0700) Subject: [IPV6] ROUTE: Purge clones on other trees when deleting a route. X-Git-Tag: v2.6.19-rc1~1272^2~193 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=150730d5a53b1bbb486101b2a5fb82ff0d3f916e;p=linux-2.6 [IPV6] ROUTE: Purge clones on other trees when deleting a route. Based on MIPL2 kernel patch. Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: Ville Nuorvala --- diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 6536e33d83..f0fdaf182b 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -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