Skip to content

Commit

Permalink
ipv6 addrconf: disallow rtr_solicits < -1
Browse files Browse the repository at this point in the history
This disallows setting /proc/sys/net/ipv6/conf/*/router_solicitations
to values below -1.

-1 continues to mean an unlimited number of retransmits.

Note: this depends on 'ipv6 addrconf: remove addrconf_sysctl_hop_limit()'

Signed-off-by: Maciej Żenczykowski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
zenczykowski authored and davem330 committed Oct 8, 2016
1 parent 7aa6ec2 commit cb4a4c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5729,6 +5729,7 @@ int addrconf_sysctl_ignore_routes_with_linkdown(struct ctl_table *ctl,
return ret;
}

static int minus_one = -1;
static const int one = 1;
static const int two_five_five = 255;

Expand Down Expand Up @@ -5789,7 +5790,8 @@ static const struct ctl_table addrconf_sysctl[] = {
.data = &ipv6_devconf.rtr_solicits,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &minus_one,
},
{
.procname = "router_solicitation_interval",
Expand Down

0 comments on commit cb4a4c6

Please sign in to comment.