]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS UPnP: Support build on OS X
authorJouni Malinen <jouni@codeaurora.org>
Tue, 9 Jun 2020 09:48:13 +0000 (12:48 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 9 Jun 2020 09:48:13 +0000 (12:48 +0300)
Define MAC address fetching for OS X (by reusing the existing FreeBSD
implementation) to allow full compile testing of the WPS implementation
on a more BSD-like platform.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/wps/wps_upnp.c

index 16fefc77be24f5e384feb060e63f53f0ba746856..ff58cb938a9c57465641eb6bfc294c0a904edde9 100644 (file)
@@ -862,7 +862,7 @@ fail:
 }
 
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
 #include <sys/sysctl.h>
 #include <net/route.h>
 #include <net/if_dl.h>
@@ -903,7 +903,7 @@ static int eth_get(const char *device, u8 ea[ETH_ALEN])
        }
        return 0;
 }
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __APPLE__ */
 
 
 /**
@@ -963,7 +963,7 @@ int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text,
                goto fail;
        }
        os_memcpy(mac, req.ifr_addr.sa_data, 6);
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
        if (eth_get(net_if, mac) < 0) {
                wpa_printf(MSG_ERROR, "WPS UPnP: Failed to get MAC address");
                goto fail;