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 net-next] net: ipv6: avoid accepting values greater than 2 for accept_untracked_na
Date: Wed, 20 Jul 2022 10:26:03 +0200 [thread overview]
Message-ID: <3feb6514-de2c-4b95-b203-74362b3cc002@6wind.com> (raw)
In-Reply-To: <20220720065211.369241-1-jhpark1013@gmail.com>
Le 20/07/2022 à 08:52, Jaehee Park a écrit :
> The accept_untracked_na sysctl changed from a boolean to an integer
> when a new knob '2' was added. This patch provides a safeguard to avoid
> accepting values that are not defined in the sysctl. When setting a
> value greater than 2, the user will get an 'invalid argument' warning.
>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> Suggested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Suggested-by: Roopa Prabhu <roopa@nvidia.com>
> ---
> net/ipv6/addrconf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 6ed807b6c647..d3e77ea24f05 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -7042,9 +7042,9 @@ static const struct ctl_table addrconf_sysctl[] = {
> .data = &ipv6_devconf.accept_untracked_na,
> .maxlen = sizeof(int),
> .mode = 0644,
> - .proc_handler = proc_dointvec,
> + .proc_handler = proc_dointvec_minmax,
> .extra1 = (void *)SYSCTL_ZERO,
> - .extra2 = (void *)SYSCTL_ONE,
> + .extra2 = (void *)SYSCTL_TWO,
Nit: the cast is useless:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/sysctl.h#n40
Regards,
Nicolas
next prev parent reply other threads:[~2022-07-20 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 6:52 [PATCH net-next] net: ipv6: avoid accepting values greater than 2 for accept_untracked_na Jaehee Park
2022-07-20 8:26 ` Nicolas Dichtel [this message]
2022-07-20 18:37 ` Jaehee
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=3feb6514-de2c-4b95-b203-74362b3cc002@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;
as well as URLs for NNTP newsgroup(s).