diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index ea6eb44618e7..605e6f14d6ab 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -415,7 +415,7 @@ void ip6_route_input(struct sk_buff *skb) | |||
415 | int attempts = 3; | 415 | int attempts = 3; |
416 | int err; | 416 | int err; |
417 | 417 | ||
418 | strict = ipv6_addr_type(&skb->nh.ipv6h->daddr) & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL); | 418 | strict = ipv6_addr_type(&skb->nh.ipv6h->daddr) & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL) ? RT6_SELECT_F_IFACE : 0; |
419 | 419 | ||
420 | relookup: | 420 | relookup: |
421 | read_lock_bh(&rt6_lock); | 421 | read_lock_bh(&rt6_lock); |
@@ -427,12 +427,16 @@ restart: | |||
427 | rt = fn->leaf; | 427 | rt = fn->leaf; |
428 | 428 | ||
429 | if ((rt->rt6i_flags & RTF_CACHE)) { | 429 | if ((rt->rt6i_flags & RTF_CACHE)) { |
430 | rt = rt6_device_match(rt, skb->dev->ifindex, strict); | 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); | ||
431 | BACKTRACK(); | 433 | BACKTRACK(); |
432 | goto out; | 434 | goto out; |
433 | } | 435 | } |
434 | 436 | ||
435 | rt = rt6_device_match(rt, skb->dev->ifindex, strict); | 437 | rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict | RT6_SELECT_F_REACHABLE); |
438 | if (rt == &ip6_null_entry) | ||
439 | rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict); | ||
436 | BACKTRACK(); | 440 | BACKTRACK(); |
437 | 441 | ||
438 | dst_hold(&rt->u.dst); | 442 | dst_hold(&rt->u.dst); |
@@ -497,7 +501,9 @@ restart: | |||
497 | rt = fn->leaf; | 501 | rt = fn->leaf; |
498 | 502 | ||
499 | if ((rt->rt6i_flags & RTF_CACHE)) { | 503 | if ((rt->rt6i_flags & RTF_CACHE)) { |
500 | rt = rt6_device_match(rt, fl->oif, strict); | 504 | rt = rt6_select(&fn->leaf, fl->oif, strict | RT6_SELECT_F_REACHABLE); |
505 | if (rt == &ip6_null_entry) | ||
506 | rt = rt6_select(&fn->leaf, fl->oif, strict); | ||
501 | BACKTRACK(); | 507 | BACKTRACK(); |
502 | goto out; | 508 | goto out; |
503 | } | 509 | } |
@@ -506,7 +512,9 @@ restart: | |||
506 | if (rt == &ip6_null_entry) | 512 | if (rt == &ip6_null_entry) |
507 | rt = rt6_select(&fn->leaf, fl->oif, strict); | 513 | rt = rt6_select(&fn->leaf, fl->oif, strict); |
508 | } else { | 514 | } else { |
509 | rt = rt6_device_match(rt, fl->oif, strict); | 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); | ||
510 | BACKTRACK(); | 518 | BACKTRACK(); |
511 | } | 519 | } |
512 | 520 | ||