public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] neigh: set nud_state to NUD_INCOMPLETE when probing router reachability
@ 2014-05-07  9:33 Duan Jiong
  2014-05-09  3:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Duan Jiong @ 2014-05-07  9:33 UTC (permalink / raw)
  To: David Miller, Jiri Benc, hannes; +Cc: netdev


Since commit 7e98056964("ipv6: router reachability probing"), a router falls
into NUD_FAILED will be probed.

Now if function rt6_select() selects a router which neighbour state is NUD_FAILED,
and at the same time function rt6_probe() changes the neighbour state to NUD_PROBE,
then function dst_neigh_output() can directly send packets, but actually the
neighbour still is unreachable. If we set nud_state to NUD_INCOMPLETE instead
NUD_PROBE, packets will not be sent out until the neihbour is reachable.

In addition, use neigh_max_probes() to simplify function.

Signed-off-by: Duan Jiong <duanj.fnst@cn•fujitsu.com>
---
 net/core/neighbour.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 8f8a96e..32d872e 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1248,8 +1248,8 @@ void __neigh_set_probe_once(struct neighbour *neigh)
 	neigh->updated = jiffies;
 	if (!(neigh->nud_state & NUD_FAILED))
 		return;
-	neigh->nud_state = NUD_PROBE;
-	atomic_set(&neigh->probes, NEIGH_VAR(neigh->parms, UCAST_PROBES));
+	neigh->nud_state = NUD_INCOMPLETE;
+	atomic_set(&neigh->probes, neigh_max_probes(neigh));
 	neigh_add_timer(neigh,
 			jiffies + NEIGH_VAR(neigh->parms, RETRANS_TIME));
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] neigh: set nud_state to NUD_INCOMPLETE when probing router reachability
  2014-05-07  9:33 [PATCH] neigh: set nud_state to NUD_INCOMPLETE when probing router reachability Duan Jiong
@ 2014-05-09  3:11 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-05-09  3:11 UTC (permalink / raw)
  To: duanj.fnst; +Cc: jbenc, hannes, netdev

From: Duan Jiong <duanj.fnst@cn•fujitsu.com>
Date: Wed, 7 May 2014 17:33:27 +0800

> In addition, use neigh_max_probes() to simplify function.
 ...
> -	atomic_set(&neigh->probes, NEIGH_VAR(neigh->parms, UCAST_PROBES));
...
> +	atomic_set(&neigh->probes, neigh_max_probes(neigh));

This is not an equivalent transformation, this changes things, in
particular APP_PROBES will be included now.

That's a functional change, not just "to simplify the function."

You'll therefore need to explain in detail why this is a valid
change and why it should be made.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-09  3:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-07  9:33 [PATCH] neigh: set nud_state to NUD_INCOMPLETE when probing router reachability Duan Jiong
2014-05-09  3:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox