aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-07-01 22:29:07 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-01 22:29:07 -0400
commit6dbf4bcac98bbc76ef425b3a2b4169f31199f6c7 (patch)
tree3ec9383233cdbebcd26a0ab1e7f666ff8cc03b5f
parent28f49d8fec19833672a6a813bfde0068fee50bc9 (diff)
icmp: fix units for ratelimit
Convert the sysctl values for icmp ratelimit to use milliseconds instead of jiffies which is based on kernel configured HZ. Internal kernel jiffies are not a proper unit for any userspace API. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/ip-sysctl.txt10
-rw-r--r--net/ipv4/sysctl_net_ipv4.c3
-rw-r--r--net/ipv6/icmp.c3
3 files changed, 10 insertions, 6 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 17a6e46fbd43..71c7bea97160 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -548,8 +548,9 @@ icmp_echo_ignore_broadcasts - BOOLEAN
548icmp_ratelimit - INTEGER 548icmp_ratelimit - INTEGER
549 Limit the maximal rates for sending ICMP packets whose type matches 549 Limit the maximal rates for sending ICMP packets whose type matches
550 icmp_ratemask (see below) to specific targets. 550 icmp_ratemask (see below) to specific targets.
551 0 to disable any limiting, otherwise the maximal rate in jiffies(1) 551 0 to disable any limiting,
552 Default: 100 552 otherwise the minimal space between responses in milliseconds.
553 Default: 1000
553 554
554icmp_ratemask - INTEGER 555icmp_ratemask - INTEGER
555 Mask made of ICMP types for which rates are being limited. 556 Mask made of ICMP types for which rates are being limited.
@@ -1027,8 +1028,9 @@ max_addresses - INTEGER
1027icmp/*: 1028icmp/*:
1028ratelimit - INTEGER 1029ratelimit - INTEGER
1029 Limit the maximal rates for sending ICMPv6 packets. 1030 Limit the maximal rates for sending ICMPv6 packets.
1030 0 to disable any limiting, otherwise the maximal rate in jiffies(1) 1031 0 to disable any limiting,
1031 Default: 100 1032 otherwise the minimal space between responses in milliseconds.
1033 Default: 1000
1032 1034
1033 1035
1034IPv6 Update by: 1036IPv6 Update by:
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 901607003205..14ef202a2254 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -793,7 +793,8 @@ static struct ctl_table ipv4_net_table[] = {
793 .data = &init_net.ipv4.sysctl_icmp_ratelimit, 793 .data = &init_net.ipv4.sysctl_icmp_ratelimit,
794 .maxlen = sizeof(int), 794 .maxlen = sizeof(int),
795 .mode = 0644, 795 .mode = 0644,
796 .proc_handler = &proc_dointvec 796 .proc_handler = &proc_dointvec_ms_jiffies,
797 .strategy = &sysctl_ms_jiffies
797 }, 798 },
798 { 799 {
799 .ctl_name = NET_IPV4_ICMP_RATEMASK, 800 .ctl_name = NET_IPV4_ICMP_RATEMASK,
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 399d41f65437..abedf95fdf2d 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -954,7 +954,8 @@ ctl_table ipv6_icmp_table_template[] = {
954 .data = &init_net.ipv6.sysctl.icmpv6_time, 954 .data = &init_net.ipv6.sysctl.icmpv6_time,
955 .maxlen = sizeof(int), 955 .maxlen = sizeof(int),
956 .mode = 0644, 956 .mode = 0644,
957 .proc_handler = &proc_dointvec 957 .proc_handler = &proc_dointvec_ms_jiffies,
958 .strategy = &sysctl_ms_jiffies
958 }, 959 },
959 { .ctl_name = 0 }, 960 { .ctl_name = 0 },
960}; 961};