aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-03-20 20:01:24 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 20:01:24 -0500
commit1ddef044ed9dd6c7c23562d1140522e28de888a5 (patch)
tree22b288e5be9e258e75f131760a689064ee63ecd0 /net/ipv6/route.c
parent118f8c1654b8f2e79fa0eb8b2d84283ab62a5498 (diff)
[IPV6]: ROUTE: Clean up rt6_select() code path in ip6_route_{intput,output}().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 605e6f14d6ab..1a314bc77863 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -426,18 +426,12 @@ relookup:
426restart: 426restart:
427 rt = fn->leaf; 427 rt = fn->leaf;
428 428
429 if ((rt->rt6i_flags & RTF_CACHE)) {
430 rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict | RT6_SELECT_F_REACHABLE);
431 if (rt == &ip6_null_entry)
432 rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict);
433 BACKTRACK();
434 goto out;
435 }
436
437 rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict | RT6_SELECT_F_REACHABLE); 429 rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict | RT6_SELECT_F_REACHABLE);
438 if (rt == &ip6_null_entry) 430 if (rt == &ip6_null_entry)
439 rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict); 431 rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict);
440 BACKTRACK(); 432 BACKTRACK();
433 if ((rt->rt6i_flags & RTF_CACHE))
434 goto out;
441 435
442 dst_hold(&rt->u.dst); 436 dst_hold(&rt->u.dst);
443 read_unlock_bh(&rt6_lock); 437 read_unlock_bh(&rt6_lock);
@@ -498,25 +492,12 @@ relookup:
498 fn = fib6_lookup(&ip6_routing_table, &fl->fl6_dst, &fl->fl6_src); 492 fn = fib6_lookup(&ip6_routing_table, &fl->fl6_dst, &fl->fl6_src);
499 493
500restart: 494restart:
501 rt = fn->leaf; 495 rt = rt6_select(&fn->leaf, fl->oif, strict | RT6_SELECT_F_REACHABLE);
502 496 if (rt == &ip6_null_entry)
503 if ((rt->rt6i_flags & RTF_CACHE)) { 497 rt = rt6_select(&fn->leaf, fl->oif, strict);
504 rt = rt6_select(&fn->leaf, fl->oif, strict | RT6_SELECT_F_REACHABLE); 498 BACKTRACK();
505 if (rt == &ip6_null_entry) 499 if ((rt->rt6i_flags & RTF_CACHE))
506 rt = rt6_select(&fn->leaf, fl->oif, strict);
507 BACKTRACK();
508 goto out; 500 goto out;
509 }
510 if (rt->rt6i_flags & RTF_DEFAULT) {
511 rt = rt6_select(&fn->leaf, fl->oif, strict | RT6_SELECT_F_REACHABLE);
512 if (rt == &ip6_null_entry)
513 rt = rt6_select(&fn->leaf, fl->oif, strict);
514 } else {
515 rt = rt6_select(&fn->leaf, fl->oif, strict | RT6_SELECT_F_REACHABLE);
516 if (rt == &ip6_null_entry)
517 rt = rt6_select(&fn->leaf, fl->oif, strict);
518 BACKTRACK();
519 }
520 501
521 dst_hold(&rt->u.dst); 502 dst_hold(&rt->u.dst);
522 read_unlock_bh(&rt6_lock); 503 read_unlock_bh(&rt6_lock);