From: Roy Marples Date: Fri, 1 May 2015 16:06:39 +0000 (+0000) Subject: Fix some compiler warnings. X-Git-Tag: v6.8.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=225dcdbdebb4baecf44b24df2d45644e0f32a3f4;p=thirdparty%2Fdhcpcd.git Fix some compiler warnings. --- diff --git a/dhcp6.c b/dhcp6.c index 76199f1d..9b00b402 100644 --- 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 diff --git a/dhcpcd.c b/dhcpcd.c index 18c19e99..2ffdac1d 100644 --- 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 diff --git a/if-linux.c b/if-linux.c index 5ed0e5b3..9871d6b4 100644 --- a/if-linux.c +++ b/if-linux.c @@ -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)