summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-30 14:50:25 +0000
committerRoy Marples <roy@marples.name>2020-05-30 14:50:25 +0000
commitc3358e3e0c8c19e5a9110140dd2b099a612afd43 (patch)
tree94992860dcb6370c37ec158d7180649c18a2d95c
parent422de9e23a64eef17d9049c16925677fca64ad9f (diff)
downloaddhcpcd-c3358e3e0c8c19e5a9110140dd2b099a612afd43.tar.xz
Fix compile with inet or inet6 disabled
-rw-r--r--src/if-options.c2
-rw-r--r--src/ipv6.c4
-rw-r--r--src/privsep-root.c4
3 files changed, 7 insertions, 3 deletions
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);