From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Jiri Benc <jbenc@redhat.com>
Subject: Re: [PATCH v2] neigh: set nud_state to NUD_INCOMPLETE when probing router reachability
Date: Mon, 12 May 2014 11:26:10 +0800 [thread overview]
Message-ID: <53703F52.9060900@cn.fujitsu.com> (raw)
In-Reply-To: <1399845863.17976.116165369.3E7E2F36@webmail.messagingengine.com>
于 2014年05月12日 06:04, Hannes Frederic Sowa 写道:
> On Thu, May 8, 2014, at 22:16, Duan Jiong wrote:
>>
>> 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, because the route should be probes with a single NS, so we must
>> set neigh->probes to neigh_max_probes(), then the neigh timer timeout and function
>> neigh_timer_handler() will not send other NS Messages.
>>
>> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>> ---
>> Changes from v1:
>> *modify changelog to explain in detail why use neigh_max_probes().
>>
>> 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));
>
> Wouldn't it be better if we neigh_suspect the neighbour and leaving the state in NUD_PROBE? We call down to ->output in case neighbour is in NUD_PROBE state, so we must just disable connected 'fast-path'.
>
You can look into neigh_event_send() called in neigh_resolve_output(), and if neigh->nud_state
still is NUD_PROBE, the neigh_event_send() will return 0, so the packet will still be sent out
without probe.
So, using neigh_suspect is not a good idea.
Thanks,
Duan
> Greetings,
>
> Hannes
> .
>
next prev parent reply other threads:[~2014-05-12 3:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 5:16 [PATCH v2] neigh: set nud_state to NUD_INCOMPLETE when probing router reachability Duan Jiong
2014-05-11 22:04 ` Hannes Frederic Sowa
2014-05-12 3:26 ` Duan Jiong [this message]
2014-05-12 18:37 ` David Miller
2014-05-13 1:07 ` Duan Jiong
2014-05-13 3:25 ` David Miller
2014-05-13 5:12 ` Duan Jiong
2014-05-13 16:39 ` Hannes Frederic Sowa
2014-05-13 16:43 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53703F52.9060900@cn.fujitsu.com \
--to=duanj.fnst@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=jbenc@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).