]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
inet: use ntohl with IN_LINKLOCAL
authorRoy Marples <roy@marples.name>
Tue, 1 Oct 2019 18:08:36 +0000 (19:08 +0100)
committerRoy Marples <roy@marples.name>
Tue, 1 Oct 2019 18:08:36 +0000 (19:08 +0100)
src/ipv4.c

index 09b24266bb15090b7b87d9fdc0b26296e5d67114..ff30fda0dd72b9650b4fbb13c24457734d405167 100644 (file)
@@ -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