]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile warnings on NetBSD ERLITE.
authorRoy Marples <roy@marples.name>
Wed, 8 Mar 2017 22:55:59 +0000 (22:55 +0000)
committerRoy Marples <roy@marples.name>
Wed, 8 Mar 2017 22:55:59 +0000 (22:55 +0000)
bpf.c
dhcp6.c

diff --git a/bpf.c b/bpf.c
index 9ceadbb9342eb3be19b9d0c8a4aecacb27b387c6..c3e2ff58ad2111e50add553a613a06dcd299fbcc 100644 (file)
--- a/bpf.c
+++ b/bpf.c
@@ -316,8 +316,13 @@ bpf_cmp_hwaddr(struct bpf_insn *bpf, size_t bpf_len, size_t off,
 
        /* Skip to positive finish. */
        njmps++;
-       jt = equal ? (uint8_t)njmps : 0;
-       jf = equal ? 0 : (uint8_t)njmps;
+       if (equal) {
+               jt = (uint8_t)njmps;
+               jf = 0;
+       } else {
+               jt = 0;
+               jf = (uint8_t)njmps;
+       }
 
        bp = bpf;
        for (; hwaddr_len > 0;
diff --git a/dhcp6.c b/dhcp6.c
index e0a4ff3c58d4651ebf4b6d969e14b80e157bf20f..c0d18549eca1717c8e64744630da3fdd748319b7 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -793,7 +793,8 @@ dhcp6_makemessage(struct interface *ifp)
 #define NEXTLEN (p + offsetof(struct dhcp6_option, len))
 
        p = (uint8_t *)state->send + sizeof(*state->send);
-       COPYIN(D6_OPTION_CLIENTID, ifp->ctx->duid, ifp->ctx->duid_len);
+       COPYIN(D6_OPTION_CLIENTID, ifp->ctx->duid,
+           (uint16_t)ifp->ctx->duid_len);
 
        if (si != NULL)
                COPYIN(D6_OPTION_SERVERID, si, si_len);
@@ -856,7 +857,8 @@ dhcp6_makemessage(struct interface *ifp)
                                        if (u8)
                                                *ep = (uint8_t)(*pp << u8);
                                        n++;
-                                       COPYIN(D6_OPTION_PD_EXCLUDE, exb, n);
+                                       COPYIN(D6_OPTION_PD_EXCLUDE, exb,
+                                           (uint16_t)n);
                                        ia_na_len = (uint16_t)
                                            (ia_na_len + sizeof(o) + n);
                                }