From: Roy Marples Date: Fri, 28 Feb 2014 11:02:32 +0000 (+0000) Subject: Tidy some INET only and INET6 only warnings. X-Git-Tag: v6.3.1~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a02120fc83539ac48ef6ba6511e955e4e7d6334;p=thirdparty%2Fdhcpcd.git Tidy some INET only and INET6 only warnings. --- diff --git a/if-options.c b/if-options.c index eaafefbe..3c3acce7 100644 --- a/if-options.c +++ b/if-options.c @@ -629,6 +629,9 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, dop = NULL; dop_len = NULL; +#ifdef INET6 + i = 0; +#endif switch(opt) { case 'f': /* FALLTHROUGH */ case 'g': /* FALLTHROUGH */ diff --git a/script.c b/script.c index ce12bade..3bdf82a6 100644 --- a/script.c +++ b/script.c @@ -221,32 +221,46 @@ make_env(const struct interface *ifp, const char *reason, char ***argv) ssize_t e, elen, l; const struct if_options *ifo = ifp->options; const struct interface *ifp2; - int dhcp, dhcp6, ra; +#ifdef INET + int dhcp; const struct dhcp_state *state; +#endif #ifdef INET6 const struct dhcp6_state *d6_state; + int dhcp6, ra; #endif - dhcp = dhcp6 = ra = 0; +#ifdef INET + dhcp = 0; state = D_STATE(ifp); +#endif #ifdef INET6 + dhcp6 = ra = 0; d6_state = D6_CSTATE(ifp); #endif if (strcmp(reason, "TEST") == 0) { + if (1 == 2) {} #ifdef INET6 - if (d6_state && d6_state->new) + else if (d6_state && d6_state->new) dhcp6 = 1; else if (ipv6nd_has_ra(ifp)) ra = 1; - else #endif +#ifdef INET + else dhcp = 1; - } else if (reason[strlen(reason) - 1] == '6') +#endif + } +#ifdef INET6 + else if (reason[strlen(reason) - 1] == '6') dhcp6 = 1; else if (strcmp(reason, "ROUTERADVERT") == 0) ra = 1; +#endif +#ifdef INET else dhcp = 1; +#endif /* When dumping the lease, we only want to report interface and reason - the other interface variables are meaningless */ @@ -303,7 +317,10 @@ make_env(const struct interface *ifp, const char *reason, char ***argv) if (strcmp(reason, "TEST") == 0) { env[9] = strdup("if_up=false"); env[10] = strdup("if_down=false"); - } else if ((dhcp && state && state->new) + } else if (1 == 2 /* appease ifdefs */ +#ifdef INET + || (dhcp && state && state->new) +#endif #ifdef INET6 || (dhcp6 && d6_state && d6_state->new) || (ra && ipv6nd_has_ra(ifp))