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>
This commit is contained in:
parent
c9d8f1a642
commit
ba6b918ab2
4 changed files with 20 additions and 14 deletions
|
@ -1658,6 +1658,14 @@ static __net_init int inet_init_net(struct net *net)
|
|||
seqlock_init(&net->ipv4.ip_local_ports.lock);
|
||||
net->ipv4.ip_local_ports.range[0] = 32768;
|
||||
net->ipv4.ip_local_ports.range[1] = 61000;
|
||||
|
||||
seqlock_init(&net->ipv4.ping_group_range.lock);
|
||||
/*
|
||||
* Sane defaults - nobody may create ping sockets.
|
||||
* Boot scripts should set this to distro-specific group.
|
||||
*/
|
||||
net->ipv4.ping_group_range.range[0] = make_kgid(&init_user_ns, 1);
|
||||
net->ipv4.ping_group_range.range[1] = make_kgid(&init_user_ns, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue