Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,5 +753,5 @@ dhcp_auth_encode(struct dhcpcd_ctx *ctx, struct auth *auth,
}

/* Done! */
return (int)(dlen - sizeof(hmac_code)); /* should be zero */
return (ssize_t)(dlen - sizeof(hmac_code)); /* should be zero */
}
2 changes: 1 addition & 1 deletion src/dhcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ dhcp_env(FILE *fenv, const char *prefix, const struct interface *ifp,
dhcp_envoption(ifp->ctx, fenv, prefix, ifp->name, opt,
dhcp_getoption, p, pl);

if (opt->option != DHO_VIVSO || pl <= (int)sizeof(uint32_t))
if (opt->option != DHO_VIVSO || pl <= sizeof(uint32_t))
continue;
memcpy(&en, p, sizeof(en));
en = ntohl(en);
Expand Down
3 changes: 2 additions & 1 deletion src/dhcpcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include <net/if.h>

#include <stdint.h>
#include <stdio.h>

#include "config.h"
Expand Down Expand Up @@ -109,7 +110,7 @@ TAILQ_HEAD(if_head, interface);
#define ALIGNBYTES (sizeof(int) - 1)
#endif
#ifndef ALIGN
#define ALIGN(p) (((unsigned int)(p) + ALIGNBYTES) & ~ALIGNBYTES)
#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) & ~(uintptr_t)ALIGNBYTES)
#endif
#ifndef CMSG_SPACE
#define CMSG_SPACE(len) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(len))
Expand Down
12 changes: 6 additions & 6 deletions src/if-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
{
int e, i, t;
long l;
unsigned long u;
uint32_t u;
char *p = NULL, *bp, *fp, *np;
ssize_t s;
struct in_addr addr, addr2;
Expand Down Expand Up @@ -1043,7 +1043,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
}

for (sl = 0, vsio = *vsiop; sl < *vsio_lenp; sl++, vsio++) {
if (vsio->en == (uint32_t)u)
if (vsio->en == u)
break;
}
if (sl == *vsio_lenp) {
Expand All @@ -1056,7 +1056,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
}
*vsiop = vsio;
vsio = &(*vsiop)[(*vsio_lenp)++];
vsio->en = (uint32_t)u;
vsio->en = u;
vsio->so = NULL;
vsio->so_len = 0;
}
Expand Down Expand Up @@ -2165,7 +2165,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
ndop->encopts_len = 0;
} else
free_dhcp_opt_embenc(ndop);
ndop->option = (uint32_t)u; /* could have been 0 */
ndop->option = u; /* could have been 0 */
ndop->type = t;
ndop->len = (size_t)l;
ndop->var = np;
Expand Down Expand Up @@ -2208,7 +2208,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
return -1;
}
for (vivco = ifo->vivco; vivco != vivco_endp; vivco++) {
if (vivco->en == (uint32_t)u) {
if (vivco->en == u) {
logerrx(
"vendor class option for enterprise number %u already defined",
vivco->en);
Expand Down Expand Up @@ -2246,7 +2246,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
}
ifo->vivco = vivco;
vivco = &ifo->vivco[ifo->vivco_len++];
vivco->en = (uint32_t)u;
vivco->en = u;
vivco->len = dl;
vivco->data = (uint8_t *)np;
break;
Expand Down
Loading