From: Roy Marples Date: Tue, 1 Oct 2019 18:08:36 +0000 (+0100) Subject: inet: use ntohl with IN_LINKLOCAL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eefc51ee9dff17d8147f47515c791f2ffd2c436d;p=thirdparty%2Fdhcpcd.git inet: use ntohl with IN_LINKLOCAL --- diff --git a/src/ipv4.c b/src/ipv4.c index 09b24266..ff30fda0 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -145,7 +145,7 @@ ipv4_iffindlladdr(struct interface *ifp) state = IPV4_STATE(ifp); if (state) { TAILQ_FOREACH(ap, &state->addrs, next) { - if (IN_LINKLOCAL(htonl(ap->addr.s_addr))) + if (IN_LINKLOCAL(ntohl(ap->addr.s_addr))) return ap; } } @@ -938,7 +938,7 @@ ipv4_handleifa(struct dhcpcd_ctx *ctx, if (addr->s_addr != INADDR_ANY && addr->s_addr != INADDR_BROADCAST) { /* If the handler deletes the address, the other might crash. * So only call one handler based on the address type. */ - if (IN_LINKLOCAL(addr->s_addr)) + if (IN_LINKLOCAL(ntohl(addr->s_addr))) #ifdef IPV4LL ipv4ll_handleifa(cmd, ia, pid); #else