diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2014-05-06 14:02:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-08 22:50:47 -0400 |
commit | ba6b918ab234186d3aa1663e296586a1b526b77a (patch) | |
tree | 6a392f2d78ca1956193b774abfba608f31776ec6 /net/ipv4/af_inet.c | |
parent | c9d8f1a64225dfcc2f721d73a5984a2444920744 (diff) |
ping: move ping_group_range out of CONFIG_SYSCTL
Similarly, when CONFIG_SYSCTL is not set, ping_group_range should still
work, just that no one can change it. Therefore we should move it out of
sysctl_net_ipv4.c. And, it should not share the same seqlock with
ip_local_port_range.
BTW, rename it to ->ping_group_range instead.
Cc: David S. Miller <davem@davemloft.net>
Cc: Francois Romieu <romieu@fr.zoreil.com>
Reported-by: Stefan de Konink <stefan@konink.de>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index cccc8e487c7e..6d6dd345bc4d 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1658,6 +1658,14 @@ static __net_init int inet_init_net(struct net *net) | |||
1658 | seqlock_init(&net->ipv4.ip_local_ports.lock); | 1658 | seqlock_init(&net->ipv4.ip_local_ports.lock); |
1659 | net->ipv4.ip_local_ports.range[0] = 32768; | 1659 | net->ipv4.ip_local_ports.range[0] = 32768; |
1660 | net->ipv4.ip_local_ports.range[1] = 61000; | 1660 | net->ipv4.ip_local_ports.range[1] = 61000; |
1661 | |||
1662 | seqlock_init(&net->ipv4.ping_group_range.lock); | ||
1663 | /* | ||
1664 | * Sane defaults - nobody may create ping sockets. | ||
1665 | * Boot scripts should set this to distro-specific group. | ||
1666 | */ | ||
1667 | net->ipv4.ping_group_range.range[0] = make_kgid(&init_user_ns, 1); | ||
1668 | net->ipv4.ping_group_range.range[1] = make_kgid(&init_user_ns, 0); | ||
1661 | return 0; | 1669 | return 0; |
1662 | } | 1670 | } |
1663 | 1671 | ||