提交 f56e03e8 编写于 作者: V Vasiliy Kulikov 提交者: David S. Miller

net: ping: fix build failure

If CONFIG_PROC_SYSCTL=n the building process fails:

    ping.c:(.text+0x52af3): undefined reference to `inet_get_ping_group_range_net'

Moved inet_get_ping_group_range_net() to ping.c.
Reported-by: NRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: NVasiliy Kulikov <segoon@openwall.com>
Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
Acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6dcae1ea
...@@ -44,8 +44,6 @@ extern struct proto ping_prot; ...@@ -44,8 +44,6 @@ extern struct proto ping_prot;
extern void ping_rcv(struct sk_buff *); extern void ping_rcv(struct sk_buff *);
extern void ping_err(struct sk_buff *, u32 info); extern void ping_err(struct sk_buff *, u32 info);
extern void inet_get_ping_group_range_net(struct net *net, unsigned int *low, unsigned int *high);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern int __init ping_proc_init(void); extern int __init ping_proc_init(void);
extern void ping_proc_exit(void); extern void ping_proc_exit(void);
......
...@@ -187,6 +187,19 @@ static struct sock *ping_v4_lookup(struct net *net, u32 saddr, u32 daddr, ...@@ -187,6 +187,19 @@ static struct sock *ping_v4_lookup(struct net *net, u32 saddr, u32 daddr,
return sk; return sk;
} }
static void inet_get_ping_group_range_net(struct net *net, gid_t *low, gid_t *high)
{
gid_t *data = net->ipv4.sysctl_ping_group_range;
unsigned seq;
do {
seq = read_seqbegin(&sysctl_local_ports.lock);
*low = data[0];
*high = data[1];
} while (read_seqretry(&sysctl_local_ports.lock, seq));
}
static int ping_init_sock(struct sock *sk) static int ping_init_sock(struct sock *sk)
{ {
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
......
...@@ -73,18 +73,6 @@ static int ipv4_local_port_range(ctl_table *table, int write, ...@@ -73,18 +73,6 @@ static int ipv4_local_port_range(ctl_table *table, int write,
} }
void inet_get_ping_group_range_net(struct net *net, gid_t *low, gid_t *high)
{
gid_t *data = net->ipv4.sysctl_ping_group_range;
unsigned seq;
do {
seq = read_seqbegin(&sysctl_local_ports.lock);
*low = data[0];
*high = data[1];
} while (read_seqretry(&sysctl_local_ports.lock, seq));
}
void inet_get_ping_group_range_table(struct ctl_table *table, gid_t *low, gid_t *high) void inet_get_ping_group_range_table(struct ctl_table *table, gid_t *low, gid_t *high)
{ {
gid_t *data = table->data; gid_t *data = table->data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册