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:
Cong Wang
2014-05-06 11:02:50 -07:00
committed by David S. Miller
parent c9d8f1a642
commit ba6b918ab2
4 changed files with 20 additions and 14 deletions

View File

@@ -236,15 +236,15 @@ exit:
static void inet_get_ping_group_range_net(struct net *net, kgid_t *low,
kgid_t *high)
{
kgid_t *data = net->ipv4.sysctl_ping_group_range;
kgid_t *data = net->ipv4.ping_group_range.range;
unsigned int seq;
do {
seq = read_seqbegin(&net->ipv4.ip_local_ports.lock);
seq = read_seqbegin(&net->ipv4.ping_group_range.lock);
*low = data[0];
*high = data[1];
} while (read_seqretry(&net->ipv4.ip_local_ports.lock, seq));
} while (read_seqretry(&net->ipv4.ping_group_range.lock, seq));
}