aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
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);