]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix some compiler warnings.
authorRoy Marples <roy@marples.name>
Fri, 1 May 2015 16:06:39 +0000 (16:06 +0000)
committerRoy Marples <roy@marples.name>
Fri, 1 May 2015 16:06:39 +0000 (16:06 +0000)
dhcp6.c
dhcpcd.c
if-linux.c

diff --git a/dhcp6.c b/dhcp6.c
index 76199f1d948d7825186c08e525f7f94f4311dd27..9b00b40285228736a09fb8bc22128ce8f84ab2f8 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -2203,8 +2203,9 @@ dhcp6_readlease(struct interface *ifp, int validate)
        }
 
 auth:
-       /* Authenticate the message */
+
        retval = 0;
+       /* Authenticate the message */
        o = dhcp6_getmoption(D6_OPTION_AUTH, state->new, state->new_len);
        if (o) {
                if (dhcp_auth_validate(&state->auth, &ifp->options->auth,
@@ -2239,7 +2240,7 @@ ex:
        state->new_len = 0;
        if (!(ifp->ctx->options & DHCPCD_DUMPLEASE))
                unlink(state->leasefile);
-       return 0;
+       return retval;
 }
 
 static void
index 18c19e9906ab434f94f0e517d0706e3ef82ed08c..2ffdac1d92a785fb4f45b56df84e7560ce5cab9f 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -658,10 +658,12 @@ dhcpcd_handlecarrier(struct dhcpcd_ctx *ctx, int carrier, unsigned int flags,
                        dhcpcd_handleinterface(ctx, 0, ifp->name);
 #endif
                        if (ifp->wireless) {
-                               size_t olen;
                                uint8_t ossid[IF_SSIDSIZE];
+#ifdef NOCARRIER_PRESERVE_IP
+                               size_t olen;
 
                                olen = ifp->ssid_len;
+#endif
                                memcpy(ossid, ifp->ssid, ifp->ssid_len);
                                if_getssid(ifp);
 #ifdef NOCARRIER_PRESERVE_IP
index 5ed0e5b32c80b10eb59d63cc4ab06168f5b15775..9871d6b4b1daade8e6c7c7d7cc3e03f1cb42c9a7 100644 (file)
@@ -326,7 +326,7 @@ get_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp, int fd, int flags,
        size_t buflen;
        struct nlmsghdr *nlm;
        struct sockaddr_nl nladdr;
-       socklen_t nladdr_len = sizeof(nladdr);
+       socklen_t nladdr_len;
        int r;
 
        buflen = 0;
@@ -351,6 +351,7 @@ get_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp, int fd, int flags,
                                goto eexit;
                        buf = nbuf;
                }
+               nladdr_len = sizeof(nladdr);
                bytes = recvfrom(fd, buf, buflen, flags,
                    (struct sockaddr *)&nladdr, &nladdr_len);
                if (bytes == -1 || bytes == 0)