net: ping: fix build failure
authorVasiliy Kulikov <segoon@openwall.com>
Tue, 17 May 2011 00:16:56 +0000 (00:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 May 2011 18:16:58 +0000 (14:16 -0400)
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 <randy.dunlap@oracle.com>
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ping.h
net/ipv4/ping.c
net/ipv4/sysctl_net_ipv4.c

index 23062c369c6268a7af91fb10e7b99bee2beb7f60..682b5ae9af5165dcc71b4f366c81db7a4df20c01 100644 (file)
@@ -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);
index 41836ab6c200920b0c02befda44103abb268e069..6a21da9065328d47d74506ea1602cb6853c30dd3 100644 (file)
@@ -187,6 +187,19 @@ exit:
        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);
index 28e8273bbef8850af3845802920e4448e09cf75d..57d0752e239a1dee0edcb77517b65328c8608a40 100644 (file)
@@ -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;