From: Roy Marples Date: Sun, 24 May 2020 11:30:13 +0000 (+0100) Subject: Fix prior for BSD X-Git-Tag: v9.1.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aca43094dfbb69053877f3eb45a410157443b0f;p=thirdparty%2Fdhcpcd.git Fix prior for BSD --- diff --git a/src/ipv6.c b/src/ipv6.c index 71b51bc7..ef4b7164 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -1093,11 +1093,10 @@ ipv6_anyglobal(struct interface *sifp) #if defined(PRIVSEP) && defined(HAVE_PLEDGE) if (IN_PRIVSEP(sifp->ctx)) - forwarding = ps_root_ip6forwarding(sifp->ctx) == 1; + forwarding = ps_root_ip6forwarding(sifp->ctx, NULL) == 1; else -#else - forwarding = ip6_forwarding(NULL) == 1; #endif + forwarding = ip6_forwarding(NULL) == 1; #endif diff --git a/src/privsep-bsd.c b/src/privsep-bsd.c index bf17ce9f..aa63bcd4 100644 --- a/src/privsep-bsd.c +++ b/src/privsep-bsd.c @@ -33,6 +33,12 @@ #include #include #include +#ifdef __DragonFly__ +# include +#else +# include +# include +#endif #include #include diff --git a/src/privsep-root.c b/src/privsep-root.c index 198f224c..cba469db 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -901,8 +901,8 @@ ssize_t ps_root_ip6forwarding(struct dhcpcd_ctx *ctx, const char *ifname) { - if (ps_sendcmd(ctx, ctx->ps_root_fd, - PS_IP6FORWARDING, 0, ifname, strlen(ifname) + 1) == -1) + if (ps_sendcmd(ctx, ctx->ps_root_fd, PS_IP6FORWARDING, 0, + ifname, ifname != NULL ? strlen(ifname) + 1 : 0) == -1) return -1; return ps_root_readerror(ctx, NULL, 0); }