summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-27 15:49:40 +0000
committerRoy Marples <roy@marples.name>2020-05-27 15:49:40 +0000
commita9882c1a32b800fda466c3c4af3819281bb98e00 (patch)
treeae4cf43490a9d05e006345887a8440d28e3f189d /src/if.c
parent6f04fa4d8e9635606c348b28cf84fefdf31c6810 (diff)
downloaddhcpcd-a9882c1a32b800fda466c3c4af3819281bb98e00.tar.xz
Check AF_PACKET is defined
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/if.c b/src/if.c
index 667819d2..dd9fdc05 100644
--- a/src/if.c
+++ b/src/if.c
@@ -381,7 +381,7 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
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 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
#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 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
}
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;