From: Roy Marples Date: Thu, 28 Nov 2019 22:13:35 +0000 (+0300) Subject: Solaris: Fix non PRIVSEP compile X-Git-Tag: v9.0.0~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=835f5ebf17d0996214763320bce1faed36c94fb2;p=thirdparty%2Fdhcpcd.git Solaris: Fix non PRIVSEP compile --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 4874fb78..40854a49 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -4002,8 +4002,9 @@ dhcp6_handleifa(int cmd, struct ipv6_addr *ia, pid_t pid) if (ifp->ctx->options & DHCPCD_PRIVSEP) { if (ps_inet_opendhcp6(ia) == -1) logerr(__func__); - } else { + } else #endif + { if (ia->dhcp6_fd == -1) ia->dhcp6_fd = dhcp6_openudp(ia->iface->index, &ia->addr); diff --git a/src/dhcpcd.c b/src/dhcpcd.c index f6e924fc..269f6561 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -1632,7 +1632,7 @@ main(int argc, char **argv) #ifdef INET ctx.udp_fd = -1; #endif -#ifdef INET6 +#if defined(INET6) && !defined(__sun) ctx.nd_fd = -1; #endif #ifdef DHCP6 diff --git a/src/ipv6nd.c b/src/ipv6nd.c index ebd427d1..1af16f17 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -236,7 +236,7 @@ eexit: } #ifdef __sun -static int +int ipv6nd_open(struct interface *ifp) { int fd; diff --git a/src/ipv6nd.h b/src/ipv6nd.h index d070b8aa..12b125a4 100644 --- a/src/ipv6nd.h +++ b/src/ipv6nd.h @@ -96,7 +96,11 @@ struct rs_state { #define RETRANS_TIMER 1000 /* milliseconds */ #define DELAY_FIRST_PROBE_TIME 5 /* seconds */ +#ifdef __sun +int ipv6nd_open(struct interface *); +#else int ipv6nd_open(struct dhcpcd_ctx *); +#endif void ipv6nd_recvmsg(struct dhcpcd_ctx *, struct msghdr *); void ipv6nd_printoptions(const struct dhcpcd_ctx *, const struct dhcp_opt *, size_t);