From: Roy Marples Date: Fri, 29 May 2020 18:13:11 +0000 (+0300) Subject: Solaris: Fix compile X-Git-Tag: v9.1.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11101f7ba350c8ec1cf0c7e8d333f0a0d366b591;p=thirdparty%2Fdhcpcd.git Solaris: Fix compile But if_init is failing? Odd as this has not changed. --- diff --git a/src/bpf.c b/src/bpf.c index d81ecc53..f450a043 100644 --- a/src/bpf.c +++ b/src/bpf.c @@ -251,7 +251,7 @@ bpf_read(struct bpf *bpf, void *data, size_t len) /* After 2^31 bytes, the kernel offset overflows. * To work around this bug, lseek 0. */ if (bytes == -1 && errno == EINVAL) { - lseek(fd, 0, SEEK_SET); + lseek(bpf->bpf_fd, 0, SEEK_SET); continue; } #endif diff --git a/src/if-sun.c b/src/if-sun.c index fdd9a031..13dab3a3 100644 --- a/src/if-sun.c +++ b/src/if-sun.c @@ -1600,9 +1600,9 @@ if_initrt(struct dhcpcd_ctx *ctx, rb_tree_t *routes, int af) #ifdef INET /* XXX We should fix this to write via the BPF interface. */ ssize_t -bpf_send(const struct interface *ifp, __unused int fd, uint16_t protocol, - const void *data, size_t len) +bpf_send(const struct bpf *bpf, uint16_t protocol, const void *data, size_t len) { + const struct interface *ifp = bpf->bpf_ifp; dlpi_handle_t dh; dlpi_info_t di; int r; diff --git a/src/ipv6nd.c b/src/ipv6nd.c index e56fd413..3965ff49 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -253,7 +253,7 @@ ipv6nd_openif(struct interface *ifp) if (state->nd_fd != -1) return state->nd_fd; - fd = ipv6nd_open0(true); + fd = ipv6nd_open(true); if (fd == -1) return -1; @@ -331,7 +331,9 @@ ipv6nd_sendrsprobe(void *arg) struct cmsghdr *cm; struct in6_pktinfo pi = { .ipi6_ifindex = ifp->index }; int s; +#ifndef __sun struct dhcpcd_ctx *ctx = ifp->ctx; +#endif if (ipv6_linklocal(ifp) == NULL) { logdebugx("%s: delaying Router Solicitation for LL address",