Commit b66eb3a6 authored by Jaehee Park's avatar Jaehee Park Committed by Jakub Kicinski

net: ipv6: avoid accepting values greater than 2 for accept_untracked_na

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.

Fixes: aaa5f515 ("net: ipv6: new accept_untracked_na option to accept na only if in-network")
Signed-off-by: default avatarJaehee Park <jhpark1013@gmail.com>
Suggested-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Suggested-by: default avatarRoopa Prabhu <roopa@nvidia.com>
Reviewed-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20220720183632.376138-1-jhpark1013@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 842463f2
...@@ -7042,9 +7042,9 @@ static const struct ctl_table addrconf_sysctl[] = { ...@@ -7042,9 +7042,9 @@ static const struct ctl_table addrconf_sysctl[] = {
.data = &ipv6_devconf.accept_untracked_na, .data = &ipv6_devconf.accept_untracked_na,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec_minmax,
.extra1 = (void *)SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = (void *)SYSCTL_ONE, .extra2 = SYSCTL_TWO,
}, },
{ {
/* sentinel */ /* sentinel */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment