Commit 982f56f3 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[IPV6] ROUTE: Search subtree when backtracking.

Based on MIPL2 kernel patch.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarVille Nuorvala <vnuorval@tcs.hut.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fc33165
...@@ -481,17 +481,23 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, ...@@ -481,17 +481,23 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len,
} }
#endif #endif
#define BACKTRACK() \ #define BACKTRACK(saddr) \
if (rt == &ip6_null_entry && flags & RT6_F_STRICT) { \ do { \
while ((fn = fn->parent) != NULL) { \ if (rt == &ip6_null_entry) { \
if (fn->fn_flags & RTN_TL_ROOT) { \ struct fib6_node *pn; \
dst_hold(&rt->u.dst); \ while (fn) { \
goto out; \ if (fn->fn_flags & RTN_TL_ROOT) \
goto out; \
pn = fn->parent; \
if (FIB6_SUBTREE(pn) && FIB6_SUBTREE(pn) != fn) \
fn = fib6_lookup(pn->subtree, NULL, saddr); \
else \
fn = pn; \
if (fn->fn_flags & RTN_RTINFO) \
goto restart; \
} \ } \
if (fn->fn_flags & RTN_RTINFO) \
goto restart; \
} \ } \
} } while(0)
static struct rt6_info *ip6_pol_route_lookup(struct fib6_table *table, static struct rt6_info *ip6_pol_route_lookup(struct fib6_table *table,
struct flowi *fl, int flags) struct flowi *fl, int flags)
...@@ -504,7 +510,7 @@ static struct rt6_info *ip6_pol_route_lookup(struct fib6_table *table, ...@@ -504,7 +510,7 @@ static struct rt6_info *ip6_pol_route_lookup(struct fib6_table *table,
restart: restart:
rt = fn->leaf; rt = fn->leaf;
rt = rt6_device_match(rt, fl->oif, flags & RT6_F_STRICT); rt = rt6_device_match(rt, fl->oif, flags & RT6_F_STRICT);
BACKTRACK(); BACKTRACK(&fl->fl6_src);
dst_hold(&rt->u.dst); dst_hold(&rt->u.dst);
out: out:
read_unlock_bh(&table->tb6_lock); read_unlock_bh(&table->tb6_lock);
...@@ -638,7 +644,7 @@ restart_2: ...@@ -638,7 +644,7 @@ restart_2:
restart: restart:
rt = rt6_select(&fn->leaf, fl->iif, strict | reachable); rt = rt6_select(&fn->leaf, fl->iif, strict | reachable);
BACKTRACK(); BACKTRACK(&fl->fl6_src);
if (rt == &ip6_null_entry || if (rt == &ip6_null_entry ||
rt->rt6i_flags & RTF_CACHE) rt->rt6i_flags & RTF_CACHE)
goto out; goto out;
...@@ -733,7 +739,7 @@ restart_2: ...@@ -733,7 +739,7 @@ restart_2:
restart: restart:
rt = rt6_select(&fn->leaf, fl->oif, strict | reachable); rt = rt6_select(&fn->leaf, fl->oif, strict | reachable);
BACKTRACK(); BACKTRACK(&fl->fl6_src);
if (rt == &ip6_null_entry || if (rt == &ip6_null_entry ||
rt->rt6i_flags & RTF_CACHE) rt->rt6i_flags & RTF_CACHE)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment