From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Jaehee Park <jhpark1013@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
dsahern@gmail.com, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, shuah@kernel.org,
linux-kernel@vger.kernel.org, aajith@arista.com,
roopa@nvidia.com, roopa.prabhu@gmail.com, aroulin@nvidia.com,
sbrivio@redhat.com
Subject: Re: [PATCH v3 net-next 2/3] net: ipv6: new accept_untracked_na option to accept na only if in-network
Date: Mon, 18 Jul 2022 10:35:55 +0200 [thread overview]
Message-ID: <d6240f70-858b-07ac-cab0-8483e16eff57@6wind.com> (raw)
In-Reply-To: <56d57be31141c12e9034cfa7570f2012528ca884.1657755189.git.jhpark1013@gmail.com>
Le 14/07/2022 à 01:40, Jaehee Park a écrit :
> This patch adds a third knob, '2', which extends the
> accept_untracked_na option to learn a neighbor only if the src ip is
> in the same subnet as an address configured on the interface that
> received the neighbor advertisement. This is similar to the arp_accept
> configuration for ipv4.
>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> Suggested-by: Roopa Prabhu <roopa@nvidia.com>
> ---
> Documentation/networking/ip-sysctl.rst | 51 +++++++++++++++-----------
> net/ipv6/addrconf.c | 2 +-
> net/ipv6/ndisc.c | 29 ++++++++++++---
> 3 files changed, 55 insertions(+), 27 deletions(-)
>
> diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst
> index 5c017fc1e24d..722ec4f491db 100644
> --- a/Documentation/networking/ip-sysctl.rst
> +++ b/Documentation/networking/ip-sysctl.rst
> @@ -2483,27 +2483,36 @@ drop_unsolicited_na - BOOLEAN
>
> By default this is turned off.
>
> -accept_untracked_na - BOOLEAN
> - Add a new neighbour cache entry in STALE state for routers on receiving a
> - neighbour advertisement (either solicited or unsolicited) with target
> - link-layer address option specified if no neighbour entry is already
> - present for the advertised IPv6 address. Without this knob, NAs received
> - for untracked addresses (absent in neighbour cache) are silently ignored.
> -
> - This is as per router-side behaviour documented in RFC9131.
> -
> - This has lower precedence than drop_unsolicited_na.
> -
> - This will optimize the return path for the initial off-link communication
> - that is initiated by a directly connected host, by ensuring that
> - the first-hop router which turns on this setting doesn't have to
> - buffer the initial return packets to do neighbour-solicitation.
> - The prerequisite is that the host is configured to send
> - unsolicited neighbour advertisements on interface bringup.
> - This setting should be used in conjunction with the ndisc_notify setting
> - on the host to satisfy this prerequisite.
> -
> - By default this is turned off.
> +accept_untracked_na - INTEGER
> + Define behavior for accepting neighbor advertisements from devices that
> + are absent in the neighbor cache:
> +
> + - 0 - (default) Do not accept unsolicited and untracked neighbor
> + advertisements.
> +
> + - 1 - Add a new neighbor cache entry in STALE state for routers on
> + receiving a neighbor advertisement (either solicited or unsolicited)
> + with target link-layer address option specified if no neighbor entry
> + is already present for the advertised IPv6 address. Without this knob,
> + NAs received for untracked addresses (absent in neighbor cache) are
> + silently ignored.
> +
> + This is as per router-side behavior documented in RFC9131.
> +
> + This has lower precedence than drop_unsolicited_na.
> +
> + This will optimize the return path for the initial off-link
> + communication that is initiated by a directly connected host, by
> + ensuring that the first-hop router which turns on this setting doesn't
> + have to buffer the initial return packets to do neighbor-solicitation.
> + The prerequisite is that the host is configured to send unsolicited
> + neighbor advertisements on interface bringup. This setting should be
> + used in conjunction with the ndisc_notify setting on the host to
> + satisfy this prerequisite.
> +
> + - 2 - Extend option (1) to add a new neighbor cache entry only if the
> + source IP address is in the same subnet as an address configured on
> + the interface that received the neighbor advertisement.
>
> enhanced_dad - BOOLEAN
> Include a nonce option in the IPv6 neighbor solicitation messages used for
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 88becb037eb6..6ed807b6c647 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -7042,7 +7042,7 @@ static const struct ctl_table addrconf_sysctl[] = {
> .data = &ipv6_devconf.accept_untracked_na,
> .maxlen = sizeof(int),
> .mode = 0644,
> - .proc_handler = proc_dointvec_minmax,
> + .proc_handler = proc_dointvec,
> .extra1 = (void *)SYSCTL_ZERO,
> .extra2 = (void *)SYSCTL_ONE,
Maybe keeping proc_dointvec_minmax with SYSCTL_TWO for extra2 is better to avoid
accepting all values. It enables to add another value later.
Regards,
Nicolas
next prev parent reply other threads:[~2022-07-18 8:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 23:40 [PATCH v3 net-next 0/3] net: ipv4/ipv6: new option to accept garp/untracked " Jaehee Park
2022-07-13 23:40 ` [PATCH v3 net-next 1/3] net: ipv4: new arp_accept option to accept garp " Jaehee Park
2022-07-13 23:40 ` [PATCH v3 net-next 2/3] net: ipv6: new accept_untracked_na option to accept na " Jaehee Park
2022-07-18 8:35 ` Nicolas Dichtel [this message]
2022-07-18 16:58 ` Jaehee
2022-07-13 23:40 ` [PATCH v3 net-next 3/3] selftests: net: arp_ndisc_untracked_subnets: test for arp_accept and accept_untracked_na Jaehee Park
2022-07-16 3:00 ` [PATCH v3 net-next 0/3] net: ipv4/ipv6: new option to accept garp/untracked na only if in-network patchwork-bot+netdevbpf
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=d6240f70-858b-07ac-cab0-8483e16eff57@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=aajith@arista.com \
--cc=aroulin@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=jhpark1013@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=roopa.prabhu@gmail.com \
--cc=roopa@nvidia.com \
--cc=sbrivio@redhat.com \
--cc=shuah@kernel.org \
--cc=yoshfuji@linux-ipv6.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
all inboxes | Powered by JetHome®