aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-07-06 14:56:14 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2017-07-07 16:40:53 +1000
commit14df554937c80997c610c6aef9fb89f3449f5ff4 (patch)
treec6d18249b1abdae578464d1ab70907b2023328b6 /lib
parentbc0dc192899f4462986220172a78a8cf59d22fcc (diff)
downloadSLOF-14df554937c80997c610c6aef9fb89f3449f5ff4.zip
SLOF-14df554937c80997c610c6aef9fb89f3449f5ff4.tar.gz
SLOF-14df554937c80997c610c6aef9fb89f3449f5ff4.tar.bz2
libnet: Move the external declaration of send_ip to ethernet.h
When compiling SLOF with the -Wredundant-decls compiler flag, there is currently a warning in the libnet code since the send_ip pointer is currently declared twice, one time in ipv4.h and one time in ipv6.h. To avoid this warning, let's move the declaration to IP-version independent ethernet.h instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib')
-rw-r--r--lib/libnet/ethernet.h3
-rw-r--r--lib/libnet/ipv4.h2
-rw-r--r--lib/libnet/ipv6.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/libnet/ethernet.h b/lib/libnet/ethernet.h
index e541c8f..a09e365 100644
--- a/lib/libnet/ethernet.h
+++ b/lib/libnet/ethernet.h
@@ -44,4 +44,7 @@ extern int send_ether(int fd, void* buffer, int len);
extern void fill_ethhdr(uint8_t * packet, uint16_t eth_type,
const uint8_t * src_mac, const uint8_t * dest_mac);
+/* Points either to send_ipv4() or send_ipv6() */
+extern int (*send_ip)(int fd, void *, int);
+
#endif
diff --git a/lib/libnet/ipv4.h b/lib/libnet/ipv4.h
index 5717c9a..3220ab5 100644
--- a/lib/libnet/ipv4.h
+++ b/lib/libnet/ipv4.h
@@ -71,8 +71,6 @@ extern void set_ipv4_netmask(uint32_t subnet_mask);
extern uint32_t get_ipv4_netmask(void);
extern uint32_t get_default_ipv4_netmask(char *ip_addr);
-extern int (*send_ip) (int fd, void *, int);
-
/* fills ip header */
extern void fill_iphdr(uint8_t * packet, uint16_t packetsize,
uint8_t ip_proto, uint32_t ip_src, uint32_t ip_dst);
diff --git a/lib/libnet/ipv6.h b/lib/libnet/ipv6.h
index 6f783b3..7b71b50 100644
--- a/lib/libnet/ipv6.h
+++ b/lib/libnet/ipv6.h
@@ -130,8 +130,6 @@ struct ip6_config {
};
/******************** VARIABLES **********************************************/
-/* Function pointer send_ip. Points either to send_ipv4() or send_ipv6() */
-extern int (*send_ip) (int fd, void *, int);
extern struct ip6_config ip6_state;