From: Roy Marples Date: Sun, 5 Jan 2014 08:36:40 +0000 (+0000) Subject: Fix compile errors and warnings with IPv6 disabled. X-Git-Tag: v6.2.1~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10cac6995ff17d45f2cd3fc1a848ba8e4b5eff04;p=thirdparty%2Fdhcpcd.git Fix compile errors and warnings with IPv6 disabled. --- diff --git a/dhcp-common.c b/dhcp-common.c index 7e69a2b6..3e807a51 100644 --- a/dhcp-common.c +++ b/dhcp-common.c @@ -352,9 +352,15 @@ dhcp_optlen(const struct dhcp_opt *opt, size_t dl) return (dl < sz ? 0 : sz); } +#ifdef INET6 +#define PO_IFNAME +#else +#define PO_IFNAME __unused +#endif + ssize_t print_option(char *s, ssize_t len, int type, int dl, const uint8_t *data, - const char *ifname) + PO_IFNAME const char *ifname) { const uint8_t *e, *t; uint16_t u16; diff --git a/if-options.c b/if-options.c index 9dd065e8..770245e5 100644 --- a/if-options.c +++ b/if-options.c @@ -1552,6 +1552,7 @@ read_config(const char *file, size_t buflen, ol; #endif #if !defined(INET) || !defined(INET6) + size_t i; struct dhcp_opt *opt; #endif @@ -1669,7 +1670,7 @@ read_config(const char *file, dhcp6_opts_len = ifo->dhcp6_override_len; #else for (i = 0, opt = ifo->dhcp6_override; - i < ifo->dhcp_override6_len; + i < ifo->dhcp6_override_len; i++, opt++) free_dhcp_opt_embenc(opt); free(ifo->dhcp6_override);