From e8784053a0a680ec8943ff20559c6561cb5b9a96 Mon Sep 17 00:00:00 2001 From: Chris Hiszpanski Date: Thu, 29 Jan 2015 22:26:57 -0800 Subject: Fix struct in6_pktinfo redefinition The struct in6_pktinfo is defined within netinet/in.h included with Linaro (i.e GNU) compilers. It is activated only if using a GNU compiler, which causes a build failure due to redefinition within gdhcp/common.c. Excludes redefinition on GNU compilers, while preserving definition on non-GNU compilers. --- gdhcp/common.c | 6 ------ gdhcp/common.h | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'gdhcp') diff --git a/gdhcp/common.c b/gdhcp/common.c index 48fcdefa..140d6f05 100644 --- a/gdhcp/common.c +++ b/gdhcp/common.c @@ -473,12 +473,6 @@ uint16_t dhcp_checksum(void *addr, int count) static const struct in6_addr in6addr_all_dhcp_relay_agents_and_servers_mc = IN6ADDR_ALL_DHCP_RELAY_AGENTS_AND_SERVERS_MC_INIT; -/* from netinet/in.h */ -struct in6_pktinfo { - struct in6_addr ipi6_addr; /* src/dst IPv6 address */ - unsigned int ipi6_ifindex; /* send/recv interface index */ -}; - int dhcpv6_send_packet(int index, struct dhcpv6_packet *dhcp_pkt, int len) { struct msghdr m; diff --git a/gdhcp/common.h b/gdhcp/common.h index c6927992..75abc183 100644 --- a/gdhcp/common.h +++ b/gdhcp/common.h @@ -170,6 +170,14 @@ static const uint8_t dhcp_option_lengths[] = { [OPTION_U32] = 4, }; +/* already defined within netinet/in.h if using GNU compiler */ +#ifndef __USE_GNU +struct in6_pktinfo { + struct in6_addr ipi6_addr; /* src/dst IPv6 address */ + unsigned int ipi6_ifindex; /* send/recv interface index */ +}; +#endif + uint8_t *dhcp_get_option(struct dhcp_packet *packet, int code); uint8_t *dhcpv6_get_option(struct dhcpv6_packet *packet, uint16_t pkt_len, int code, uint16_t *option_len, int *option_count); -- cgit v1.2.1