]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Guard with IP_PKTINFO as well.
authorRoy Marples <roy@marples.name>
Tue, 19 Feb 2019 22:07:08 +0000 (22:07 +0000)
committerRoy Marples <roy@marples.name>
Tue, 19 Feb 2019 22:07:08 +0000 (22:07 +0000)
src/if.c

index 9ba286d168e79af9d85ab0730cd52c9c9e094386..95067c773eeac4371894f60ea7b1dd5b67013e4e 100644 (file)
--- a/src/if.c
+++ b/src/if.c
@@ -807,7 +807,7 @@ if_findifpfromcmsg(struct dhcpcd_ctx *ctx, struct msghdr *msg, int *hoplimit)
        struct cmsghdr *cm;
        unsigned int ifindex = 0;
        struct interface *ifp;
-#ifdef INET
+#if defined(INET) && defined(IP_PKTINFO)
        struct in_pktinfo ipi;
 #endif
 #ifdef INET6
@@ -820,7 +820,7 @@ if_findifpfromcmsg(struct dhcpcd_ctx *ctx, struct msghdr *msg, int *hoplimit)
             cm;
             cm = (struct cmsghdr *)CMSG_NXTHDR(msg, cm))
        {
-#ifdef INET
+#if defined(INET) && defined(IP_PKTINFO)
                if (cm->cmsg_level == IPPROTO_IP) {
                        switch(cm->cmsg_type) {
                        case IP_PKTINFO: