From: Roy Marples Date: Sat, 30 May 2020 14:50:25 +0000 (+0000) Subject: Fix compile with inet or inet6 disabled X-Git-Tag: v9.1.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3358e3e0c8c19e5a9110140dd2b099a612afd43;p=thirdparty%2Fdhcpcd.git Fix compile with inet or inet6 disabled --- diff --git a/src/if-options.c b/src/if-options.c index 48ec6055..212e71d8 100644 --- a/src/if-options.c +++ b/src/if-options.c @@ -1242,7 +1242,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, del_option_mask(ifo->nomask, DHO_DNSSEARCH); #endif -#ifdef INET6 +#ifdef DHCP6 del_option_mask(ifo->nomask6, D6_OPTION_DNS_SERVERS); del_option_mask(ifo->nomask6, D6_OPTION_DOMAIN_LIST); del_option_mask(ifo->nomask6, D6_OPTION_SOL_MAX_RT); diff --git a/src/ipv6.c b/src/ipv6.c index ef4b7164..13e6c117 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -594,6 +594,7 @@ static void ipv6_deletedaddr(struct ipv6_addr *ia) { +#ifdef DHCP6 #ifdef PRIVSEP if (!(ia->iface->ctx->options & DHCPCD_MASTER)) ps_inet_closedhcp6(ia); @@ -607,6 +608,9 @@ ipv6_deletedaddr(struct ipv6_addr *ia) if (ia->delegating_prefix != NULL) ia->delegating_prefix->flags &= ~IPV6_AF_NOREJECT; #endif +#else + UNUSED(ia); +#endif } void diff --git a/src/privsep-root.c b/src/privsep-root.c index 5884357a..affcf3c6 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -526,7 +526,7 @@ ps_root_recvmsgcb(void *arg, struct ps_msghdr *psm, struct msghdr *msg) free_rdata = true; break; #endif -#if defined(__linux__) || defined(HAVE_PLEDGE) +#if defined(INET6) && (defined(__linux__) || defined(HAVE_PLEDGE)) case PS_IP6FORWARDING: err = ip6_forwarding(data); break; @@ -694,8 +694,8 @@ ps_root_dispatchcb(void *arg, struct ps_msghdr *psm, struct msghdr *msg) break; #endif default: - err = ps_bpf_dispatch(ctx, psm, msg); #ifdef INET + err = ps_bpf_dispatch(ctx, psm, msg); if (err == -1 && errno == ENOTSUP) #endif err = ps_inet_dispatch(ctx, psm, msg);