[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1475476917-17382-1-git-send-email-zenczykowski@gmail.com>
Date: Sun, 2 Oct 2016 23:41:57 -0700
From: Maciej Żenczykowski <zenczykowski@...il.com>
To: Maciej Żenczykowski <maze@...gle.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org, Erik Kline <ek@...gle.com>,
Lorenzo Colitti <lorenzo@...gle.com>
Subject: [PATCH] ipv6 addrconf: disallow rtr_solicits < -1
From: Maciej Żenczykowski <maze@...gle.com>
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 <maze@...gle.com>
---
net/ipv6/addrconf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index cbd9343751a2..511b76e6a50e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5729,6 +5729,7 @@ int addrconf_sysctl_ignore_routes_with_linkdown(struct ctl_table *ctl,
return ret;
}
+static const int minus_one = -1;
static const int one = 1;
static const int two_five_five = 255;
@@ -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 = (void *)&minus_one,
},
{
.procname = "router_solicitation_interval",
--
2.8.0.rc3.226.g39d4020
Powered by blists - more mailing lists