diff options
author | Chris Hiszpanski <chris@kunasystems.com> | 2015-01-29 22:26:57 -0800 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2015-02-05 15:57:08 +0200 |
commit | e8784053a0a680ec8943ff20559c6561cb5b9a96 (patch) | |
tree | fd95d892df1d0326722f445f1aba7d8d8411e632 /gdhcp | |
parent | 7dc6ae4ea72d024bb0c893ddd862c0265347fbd1 (diff) | |
download | connman-e8784053a0a680ec8943ff20559c6561cb5b9a96.tar.gz |
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.
Diffstat (limited to 'gdhcp')
-rw-r--r-- | gdhcp/common.c | 6 | ||||
-rw-r--r-- | gdhcp/common.h | 8 |
2 files changed, 8 insertions, 6 deletions
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); |