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.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c953466b7afd..b39ae99122d5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -330,6 +330,8 @@ static int inline rt6_check_neigh(struct rt6_info *rt)
330 read_lock_bh(&neigh->lock); 330 read_lock_bh(&neigh->lock);
331 if (neigh->nud_state & NUD_VALID) 331 if (neigh->nud_state & NUD_VALID)
332 m = 2; 332 m = 2;
333 else if (!(neigh->nud_state & NUD_FAILED))
334 m = 1;
333 read_unlock_bh(&neigh->lock); 335 read_unlock_bh(&neigh->lock);
334 } 336 }
335 return m; 337 return m;
@@ -347,9 +349,7 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
347 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; 349 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
348#endif 350#endif
349 n = rt6_check_neigh(rt); 351 n = rt6_check_neigh(rt);
350 if (n > 1) 352 if (!n && (strict & RT6_LOOKUP_F_REACHABLE))
351 m |= 16;
352 else if (!n && strict & RT6_LOOKUP_F_REACHABLE)
353 return -1; 353 return -1;
354 return m; 354 return m;
355} 355}
@@ -380,10 +380,11 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif,
380 continue; 380 continue;
381 381
382 if (m > mpri) { 382 if (m > mpri) {
383 rt6_probe(match); 383 if (strict & RT6_LOOKUP_F_REACHABLE)
384 rt6_probe(match);
384 match = rt; 385 match = rt;
385 mpri = m; 386 mpri = m;
386 } else { 387 } else if (strict & RT6_LOOKUP_F_REACHABLE) {
387 rt6_probe(rt); 388 rt6_probe(rt);
388 } 389 }
389 } 390 }
@@ -636,7 +637,7 @@ static struct rt6_info *ip6_pol_route_input(struct fib6_table *table,
636 int strict = 0; 637 int strict = 0;
637 int attempts = 3; 638 int attempts = 3;
638 int err; 639 int err;
639 int reachable = RT6_LOOKUP_F_REACHABLE; 640 int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
640 641
641 strict |= flags & RT6_LOOKUP_F_IFACE; 642 strict |= flags & RT6_LOOKUP_F_IFACE;
642 643
@@ -733,7 +734,7 @@ static struct rt6_info *ip6_pol_route_output(struct fib6_table *table,
733 int strict = 0; 734 int strict = 0;
734 int attempts = 3; 735 int attempts = 3;
735 int err; 736 int err;
736 int reachable = RT6_LOOKUP_F_REACHABLE; 737 int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
737 738
738 strict |= flags & RT6_LOOKUP_F_IFACE; 739 strict |= flags & RT6_LOOKUP_F_IFACE;
739 740