From: 吉藤英明 <hideaki.yoshifuji@miraclelinux.com>
To: Mahesh Bandewar <mahesh@bandewar.net>
Cc: "David Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
netdev <netdev@vger.kernel.org>,
"Ido Schimmel" <idosch@mellanox.com>,
"Hans Liljestrand" <ishkamiel@gmail.com>,
"Kees Cook" <keescook@chromium.org>,
"Reshetova Elena" <elena.reshetova@intel.com>,
"Sowmini Varadhan" <sowmini.varadhan@oracle.com>,
"Florian Westphal" <fw@strlen.de>,
"Roopa Prabhu" <roopa@cumulusnetworks.com>,
"Ihar Hrachyshka" <ihrachys@redhat.com>,
"David Ahern" <dsa@cumulusnetworks.com>,
"Zhang Shengju" <zhangshengju@cmss.chinamobile.com>,
"Mahesh Bandewar" <maheshb@google.com>,
吉藤英明 <hideaki.yoshifuji@miraclelinux.com>,
"YOSHIFUJI Hideaki" <yoshfuji@linux-ipv6.org>
Subject: Re: [PATCH next] neigh: initialize neigh entry correctly during arp processing
Date: Thu, 17 Aug 2017 09:58:33 +0900 [thread overview]
Message-ID: <CAPA1RqDjJvZkCTt0w=4LPps1vCdKEEVemXWjBXRkZMQGaLPDnw@mail.gmail.com> (raw)
In-Reply-To: <20170817000251.38469-1-mahesh@bandewar.net>
Hi,
2017-08-17 9:02 GMT+09:00 Mahesh Bandewar <mahesh@bandewar.net>:
> From: Mahesh Bandewar <maheshb@google.com>
>
> If the ARP processing creates a neigh entry, it's immediately marked
> as STALE without timer and stays that way in that state as long as
> host do not send traffic to that neighbour.
>
> I observed this on hosts which are in IPv6 environment, where there is
> very little to no IPv4 traffic and neigh-entries are stuck in STALE
> mode. Ideally, the host should have PROBEd these neighbours before it
> can send the first packet out.
No, we do not probe neighbors until we have packet for/through
it.
>
> It happens as a result of following call sequence in an environment
> where host is mostly quiet as far as IPv4 traffic but few connected
> hosts/gateways are sending ARPs.
>
> arp_process()
> neigh_event_ns()
> neigh_lookup()
> neigh_create()
> neigh_alloc()
> nud_state=NUD_NONE
> neigh_update(nud_state=NUD_STALE)
>
> In the above scenario, the neighbour entry does not get a chance to get
> PROBEd as subsequent call to neigh_update() marks this entry STALE.
> This patch initializes the neigh-entry correctly if it was created as a
> result of neigh_lookup instead of just updating it in neigh_event_ns()
> right after creating it.
>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
> net/core/neighbour.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index 16a1a4c4eb57..d8a35db6c43b 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -1300,9 +1300,13 @@ struct neighbour *neigh_event_ns(struct neigh_table *tbl,
> {
> struct neighbour *neigh = __neigh_lookup(tbl, saddr, dev,
> lladdr || !dev->addr_len);
> - if (neigh)
> - neigh_update(neigh, lladdr, NUD_STALE,
> - NEIGH_UPDATE_F_OVERRIDE, 0);
> + if (neigh) {
> + if (neigh->nud_state & NUD_VALID)
> + neigh_update(neigh, lladdr, NUD_STALE,
> + NEIGH_UPDATE_F_OVERRIDE, 0);
> + else
> + neigh_event_send(neigh, NULL);
> + }
> return neigh;
> }
> EXPORT_SYMBOL(neigh_event_ns);
> --
> 2.14.1.480.gb18f417b89-goog
>
next prev parent reply other threads:[~2017-08-17 0:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 0:02 [PATCH next] neigh: initialize neigh entry correctly during arp processing Mahesh Bandewar
2017-08-17 0:32 ` Sowmini Varadhan
2017-08-17 1:02 ` Mahesh Bandewar (महेश बंडेवार)
2017-08-17 0:58 ` 吉藤英明 [this message]
2017-08-18 23:10 ` 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='CAPA1RqDjJvZkCTt0w=4LPps1vCdKEEVemXWjBXRkZMQGaLPDnw@mail.gmail.com' \
--to=hideaki.yoshifuji@miraclelinux.com \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=edumazet@google.com \
--cc=elena.reshetova@intel.com \
--cc=fw@strlen.de \
--cc=idosch@mellanox.com \
--cc=ihrachys@redhat.com \
--cc=ishkamiel@gmail.com \
--cc=keescook@chromium.org \
--cc=mahesh@bandewar.net \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=sowmini.varadhan@oracle.com \
--cc=yoshfuji@linux-ipv6.org \
--cc=zhangshengju@cmss.chinamobile.com \
/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).