]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix build without INET or INET6
authorRoy Marples <roy@marples.name>
Thu, 2 Apr 2020 19:54:19 +0000 (19:54 +0000)
committerRoy Marples <roy@marples.name>
Thu, 2 Apr 2020 19:54:19 +0000 (19:54 +0000)
src/dhcpcd.c
src/if-bsd.c
src/if-options.c
src/privsep-root.c

index 057a1fd9e09cce5b5458da8dc966d5c0b7ab8e5c..9208f37c152af749d6bac4c2fcf8998a4654d552 100644 (file)
@@ -2169,7 +2169,7 @@ printpidfile:
        }
 #endif
 
-#ifdef BSD
+#if defined(BSD) && defined(INET6)
        /* Disable the kernel RTADV sysctl as early as possible. */
        if (ctx.options & DHCPCD_IPV6 && ctx.options & DHCPCD_IPV6RS)
                if_disable_rtadv();
index dbe5c35913f2e42a3141c04e6c160ac659d809d6..d6c3890348e7f86911357a6e5f65e48127f93c61 100644 (file)
@@ -1524,6 +1524,8 @@ if_missfilter0(struct dhcpcd_ctx *ctx, struct interface *ifp,
 #ifdef INET6
        if (sa->sa_family == AF_INET6)
                ifa_setscope(satosin6(sa), ifp->index);
+#else
+       UNUSED(ifp);
 #endif
 
        cp = ctx->rt_missfilter + ctx->rt_missfilterlen;
index 7850ff2eef65ed50ed51f7d30dd3cd82ef1b021f..1280cfbd99d0f54bdbfd8775b72ef368ebd97456 100644 (file)
@@ -573,6 +573,8 @@ set_option_space(struct dhcpcd_ctx *ctx,
                return;
        }
 #endif
+#else
+       UNUSED(arg);
 #endif
 
 #ifdef INET
@@ -1275,6 +1277,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
                memset(ifo->nomask6, 0xff, sizeof(ifo->nomask6));
 
                /* Allow the bare minimum through */
+#ifdef INET
                del_option_mask(ifo->nomask, DHO_SUBNETMASK);
                del_option_mask(ifo->nomask, DHO_CSR);
                del_option_mask(ifo->nomask, DHO_ROUTER);
@@ -1286,11 +1289,14 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
                del_option_mask(ifo->nomask, DHO_RENEWALTIME);
                del_option_mask(ifo->nomask, DHO_REBINDTIME);
                del_option_mask(ifo->nomask, DHO_DNSSEARCH);
+#endif
 
+#ifdef INET6
                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);
                del_option_mask(ifo->nomask6, D6_OPTION_INF_MAX_RT);
+#endif
 
                break;
 #ifdef INET
index f88f56dd06dd6e66fce7af101ffb4d512178b3ec..0f099bb7504270b5b4c2536878e6243e6af3a1ce 100644 (file)
@@ -435,8 +435,10 @@ ps_root_dispatchcb(void *arg, struct ps_msghdr *psm, struct msghdr *msg)
        struct dhcpcd_ctx *ctx = arg;
        ssize_t err;
 
+#ifdef INET
        err = ps_bpf_dispatch(ctx, psm, msg);
        if (err == -1 && errno == ENOTSUP)
+#endif
                err = ps_inet_dispatch(ctx, psm, msg);
        return err;
 }