Skip to content

Commit

Permalink
net: ping: fix build failure
Browse files Browse the repository at this point in the history
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: Randy Dunlap <[email protected]>
Signed-off-by: Vasiliy Kulikov <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
segoon authored and davem330 committed May 17, 2011
1 parent 6dcae1e commit f56e03e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 0 additions & 2 deletions include/net/ping.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ extern struct proto ping_prot;
extern void ping_rcv(struct sk_buff *);
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
extern int __init ping_proc_init(void);
extern void ping_proc_exit(void);
Expand Down
13 changes: 13 additions & 0 deletions net/ipv4/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,19 @@ static struct sock *ping_v4_lookup(struct net *net, u32 saddr, u32 daddr,
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)
{
struct net *net = sock_net(sk);
Expand Down
12 changes: 0 additions & 12 deletions net/ipv4/sysctl_net_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
gid_t *data = table->data;
Expand Down

0 comments on commit f56e03e

Please sign in to comment.