aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2015-07-23 03:39:35 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-26 23:56:27 -0400
commit88f643203668b95b884b60b45ff182289153843c (patch)
tree7c07eec1dcbf5d2b09d53bf1b267edef40b2a9cb
parent48fb6b554501914b6befcf9b38292cbeb91de330 (diff)
ipv4: be more aggressive when probing alternative gateways
Currently, we do not notice if new alternative gateways are added. We can do it by checking for present neigh entry. Also, gateways that are currently probed (NUD_INCOMPLETE) can be skipped from round-robin probing. Suggested-by: Florian Westphal <fw@strlen.de> Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/fib_semantics.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 6754c64b2fe0..d4c6732cfbfa 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -438,13 +438,15 @@ static int fib_detect_death(struct fib_info *fi, int order,
438 if (n) { 438 if (n) {
439 state = n->nud_state; 439 state = n->nud_state;
440 neigh_release(n); 440 neigh_release(n);
441 } else {
442 return 0;
441 } 443 }
442 if (state == NUD_REACHABLE) 444 if (state == NUD_REACHABLE)
443 return 0; 445 return 0;
444 if ((state & NUD_VALID) && order != dflt) 446 if ((state & NUD_VALID) && order != dflt)
445 return 0; 447 return 0;
446 if ((state & NUD_VALID) || 448 if ((state & NUD_VALID) ||
447 (*last_idx < 0 && order > dflt)) { 449 (*last_idx < 0 && order > dflt && state != NUD_INCOMPLETE)) {
448 *last_resort = fi; 450 *last_resort = fi;
449 *last_idx = order; 451 *last_idx = order;
450 } 452 }