summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-12-13 12:16:14 -0800
committerDavid S. Miller <davem@davemloft.net>2010-12-13 12:16:14 -0800
commit249fab773dd5f689318c969ed649c4db077cdfc3 (patch)
treecd4a07a03e262b682b31929e5b194158979e3b46 /net/ipv4
parent8c4877a4128e7931077b024a891a4b284d8756a3 (diff)
downloadlinux-stable-249fab773dd5f689318c969ed649c4db077cdfc3.tar.gz
linux-stable-249fab773dd5f689318c969ed649c4db077cdfc3.tar.bz2
linux-stable-249fab773dd5f689318c969ed649c4db077cdfc3.zip
net: add limits to ip_default_ttl
ip_default_ttl should be between 1 and 255 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/sysctl_net_ipv4.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index e85ff5930607..1a456652086b 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -28,6 +28,8 @@ static int ip_local_port_range_min[] = { 1, 1 };
static int ip_local_port_range_max[] = { 65535, 65535 };
static int tcp_adv_win_scale_min = -31;
static int tcp_adv_win_scale_max = 31;
+static int ip_ttl_min = 1;
+static int ip_ttl_max = 255;
/* Update system visible IP port range */
static void set_local_port_range(int range[2])
@@ -155,8 +157,9 @@ static struct ctl_table ipv4_table[] = {
.data = &sysctl_ip_default_ttl,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec,
- .extra2 = &init_net,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &ip_ttl_min,
+ .extra2 = &ip_ttl_max,
},
{
.procname = "ip_no_pmtu_disc",