changeset 5286:b820f26385b7 draft

Fix compile with inet or inet6 disabled
author Roy Marples <roy@marples.name>
date Sat, 30 May 2020 14:50:25 +0000
parents 7754eb6cd2eb
children d31a4f016043
files src/if-options.c src/ipv6.c src/privsep-root.c
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/if-options.c	Sat May 30 14:21:04 2020 +0000
+++ b/src/if-options.c	Sat May 30 14:50:25 2020 +0000
@@ -1242,7 +1242,7 @@
 		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);
--- a/src/ipv6.c	Sat May 30 14:21:04 2020 +0000
+++ b/src/ipv6.c	Sat May 30 14:50:25 2020 +0000
@@ -594,6 +594,7 @@
 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 @@
 	if (ia->delegating_prefix != NULL)
 		ia->delegating_prefix->flags &= ~IPV6_AF_NOREJECT;
 #endif
+#else
+	UNUSED(ia);
+#endif
 }
 
 void
--- a/src/privsep-root.c	Sat May 30 14:21:04 2020 +0000
+++ b/src/privsep-root.c	Sat May 30 14:50:25 2020 +0000
@@ -526,7 +526,7 @@
 		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 @@
 		break;
 #endif
 	default:
+#ifdef INET
 		err = ps_bpf_dispatch(ctx, psm, msg);
-#ifdef INET
 		if (err == -1 && errno == ENOTSUP)
 #endif
 			err = ps_inet_dispatch(ctx, psm, msg);