# HG changeset patch # User Roy Marples # Date 1590594580 0 # Node ID be03c967ee2abe0a73d5048c5c9dbf8063f5370e # Parent 13d407c45d58c91287a49b7332e4fccde68d29b8 Check AF_PACKET is defined diff -r 13d407c45d58 -r be03c967ee2a src/if.c --- a/src/if.c Sun May 24 14:57:18 2020 +0000 +++ b/src/if.c Wed May 27 15:49:40 2020 +0000 @@ -381,7 +381,7 @@ struct if_laddrreq iflr = { .flags = IFLR_PREFIX }; int link_fd; #endif -#elif AF_PACKET +#elif defined(AF_PACKET) const struct sockaddr_ll *sll; #endif #if defined(SIOCGIFPRIORITY) @@ -423,7 +423,7 @@ #ifdef AF_LINK if (ifa->ifa_addr->sa_family != AF_LINK) continue; -#elif AF_PACKET +#elif defined(AF_PACKET) if (ifa->ifa_addr->sa_family != AF_PACKET) continue; #endif @@ -578,7 +578,7 @@ } ifp->hwlen = sdl->sdl_alen; memcpy(ifp->hwaddr, CLLADDR(sdl), ifp->hwlen); -#elif AF_PACKET +#elif defined(AF_PACKET) sll = (const void *)ifa->ifa_addr; ifp->index = (unsigned int)sll->sll_ifindex; ifp->hwtype = sll->sll_hatype; diff -r 13d407c45d58 -r be03c967ee2a src/sa.c --- a/src/sa.c Sun May 24 14:57:18 2020 +0000 +++ b/src/sa.c Wed May 27 15:49:40 2020 +0000 @@ -32,7 +32,7 @@ #include #ifdef AF_LINK #include -#elif AF_PACKET +#elif defined(AF_PACKET) #include #endif @@ -385,7 +385,7 @@ } return hwaddr_ntoa(CLLADDR(sdl), sdl->sdl_alen, buf, len); } -#elif AF_PACKET +#elif defined(AF_PACKET) if (sa->sa_family == AF_PACKET) { const struct sockaddr_ll *sll;