]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Solaris: Fix compile
authorRoy Marples <roy@marples.name>
Fri, 29 May 2020 18:13:11 +0000 (21:13 +0300)
committerRoy Marples <roy@marples.name>
Fri, 29 May 2020 18:13:11 +0000 (21:13 +0300)
But if_init is failing? Odd as this has not changed.

src/bpf.c
src/if-sun.c
src/ipv6nd.c

index d81ecc53ed6cb398b71ceb9189d3b080095c1bca..f450a043f89ee652df7b9294cfc867858aaa717c 100644 (file)
--- 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
index fdd9a031527d8bd7ed05b486b9d0e5d5f0d92a12..13dab3a30d493b96e1471bbba61657da0aadced4 100644 (file)
@@ -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;
index e56fd413e07f780d54dfb3e83f56b8b12d537fd6..3965ff496377b017f7ba07abf3b2b2b59ffdccec 100644 (file)
@@ -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",