]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile with inet or inet6 disabled
authorRoy Marples <roy@marples.name>
Sat, 30 May 2020 14:50:25 +0000 (14:50 +0000)
committerRoy Marples <roy@marples.name>
Sat, 30 May 2020 14:50:25 +0000 (14:50 +0000)
src/if-options.c
src/ipv6.c
src/privsep-root.c

index 48ec60555212eeed5197ece7a6ab5a9fdf9bac1a..212e71d8478b71dccdbd26933859291164e723c1 100644 (file)
@@ -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);
index ef4b7164627c7d8772f50455688aa5812764abe0..13e6c11728c72fbed84cc1d269b094a6fccc38c8 100644 (file)
@@ -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
index 5884357af8e6007503ffb0839becfb04a3c35904..affcf3c6f6c13bb826854a1cfab7db984259205e 100644 (file)
@@ -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);