https://bugs.gentoo.org/949688 https://github.com/NetworkConfiguration/dhcpcd/commit/7f70a6a4e6e19703e705881da958e8a1d42d27ec From 7f70a6a4e6e19703e705881da958e8a1d42d27ec Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 13 Feb 2025 00:32:43 +0000 Subject: [PATCH] Address some build options Fixes #458. --- a/src/dhcp.c +++ b/src/dhcp.c @@ -3068,7 +3068,7 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len, struct dhcp_state *state = D_STATE(ifp); struct if_options *ifo = ifp->options; struct dhcp_lease *lease = &state->lease; - uint8_t type, tmp; + uint8_t type; struct in_addr addr; unsigned int i; char *msg; @@ -3079,6 +3079,9 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len, const uint8_t *auth; size_t auth_len; #endif +#ifdef IPV4LL + uint8_t tmp; +#endif #ifdef IN_IFF_DUPLICATED struct ipv4_addr *ia; #endif --- a/src/if-options.c +++ b/src/if-options.c @@ -655,8 +655,6 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, uint8_t *request, *require, *no, *reject; struct dhcp_opt **dop, *ndop; size_t *dop_len, dl, odl; - struct vivco *vivco; - const struct vivco *vivco_endp = ifo->vivco + ifo->vivco_len; struct group *grp; #ifdef AUTH struct token *token; @@ -665,16 +663,22 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, struct group grpbuf; #endif #ifdef DHCP6 - size_t sl; struct if_ia *ia; uint8_t iaid[4]; +#endif +#if defined(DHCP6) || ((defined(INET) || defined(INET6)) && !defined(SMALL)) + size_t sl; +#endif #ifndef SMALL - struct in6_addr in6addr; +#ifdef DHCP6 struct if_sla *sla, *slap; +#endif + struct vivco *vivco; + const struct vivco *vivco_endp = ifo->vivco + ifo->vivco_len; + struct in6_addr in6addr; struct vsio **vsiop = NULL, *vsio; size_t *vsio_lenp = NULL, opt_max, opt_header; struct vsio_so *vsio_so; -#endif #endif dop = NULL; @@ -2951,11 +2955,11 @@ free_options(struct dhcpcd_ctx *ctx, struct if_options *ifo) struct rt *rt; #endif struct dhcp_opt *opt; - struct vivco *vo; #ifdef AUTH struct token *token; #endif #ifndef SMALL + struct vivco *vo; struct vsio *vsio; struct vsio_so *vsio_so; #endif --- a/src/ipv6.c +++ b/src/ipv6.c @@ -626,7 +626,7 @@ ipv6_deletedaddr(struct ipv6_addr *ia) #endif #if !defined(DHCP6) || (!defined(PRIVSEP) && defined(SMALL)) - UNUSED(ia) + UNUSED(ia); #endif } --- a/src/privsep-inet.c +++ b/src/privsep-inet.c @@ -215,6 +215,7 @@ ps_inet_startcb(struct ps_process *psp) return ret; } +#if defined(INET) || defined(DHCP6) static bool ps_inet_validudp(struct msghdr *msg, uint16_t sport, uint16_t dport) { @@ -233,6 +234,7 @@ ps_inet_validudp(struct msghdr *msg, uint16_t sport, uint16_t dport) } return true; } +#endif #ifdef INET6 static bool