]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
icmp: fix units for ratelimit
authorStephen Hemminger <shemminger@vyatta.com>
Wed, 2 Jul 2008 02:29:07 +0000 (19:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jul 2008 02:29:07 +0000 (19:29 -0700)
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>
Documentation/networking/ip-sysctl.txt
net/ipv4/sysctl_net_ipv4.c
net/ipv6/icmp.c

index 17a6e46fbd43abfce8ad5558f99200f8389ac650..71c7bea97160609f7c029a71fc9bf658772a5da5 100644 (file)
@@ -548,8 +548,9 @@ icmp_echo_ignore_broadcasts - BOOLEAN
 icmp_ratelimit - INTEGER
        Limit the maximal rates for sending ICMP packets whose type matches
        icmp_ratemask (see below) to specific targets.
-       0 to disable any limiting, otherwise the maximal rate in jiffies(1)
-       Default: 100
+       0 to disable any limiting,
+       otherwise the minimal space between responses in milliseconds.
+       Default: 1000
 
 icmp_ratemask - INTEGER
        Mask made of ICMP types for which rates are being limited.
@@ -1027,8 +1028,9 @@ max_addresses - INTEGER
 icmp/*:
 ratelimit - INTEGER
        Limit the maximal rates for sending ICMPv6 packets.
-       0 to disable any limiting, otherwise the maximal rate in jiffies(1)
-       Default: 100
+       0 to disable any limiting,
+       otherwise the minimal space between responses in milliseconds.
+       Default: 1000
 
 
 IPv6 Update by:
index 9016070032054f9fa6d5aa30c08ff1c3f91dc9ee..14ef202a2254f21a57e4c7e5dfdd666e8ef65e63 100644 (file)
@@ -793,7 +793,8 @@ static struct ctl_table ipv4_net_table[] = {
                .data           = &init_net.ipv4.sysctl_icmp_ratelimit,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = &proc_dointvec_ms_jiffies,
+               .strategy       = &sysctl_ms_jiffies
        },
        {
                .ctl_name       = NET_IPV4_ICMP_RATEMASK,
index 399d41f65437952c3ce7cc9f1259b49400164574..abedf95fdf2dd0ca5f8cfa25cdfe0f6504395592 100644 (file)
@@ -954,7 +954,8 @@ ctl_table ipv6_icmp_table_template[] = {
                .data           = &init_net.ipv6.sysctl.icmpv6_time,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = &proc_dointvec_ms_jiffies,
+               .strategy       = &sysctl_ms_jiffies
        },
        { .ctl_name = 0 },
 };