summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmlibuv/src/unix/bsd-ifaddrs.c')
-rw-r--r--Utilities/cmlibuv/src/unix/bsd-ifaddrs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c b/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
index 0b5653d..4147894 100644
--- a/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
+++ b/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
@@ -27,7 +27,9 @@
#include <ifaddrs.h>
#include <net/if.h>
+#if !defined(__CYGWIN__) && !defined(__MSYS__)
#include <net/if_dl.h>
+#endif
static int uv__ifaddr_exclude(struct ifaddrs *ent) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
@@ -107,9 +109,13 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
for (i = 0; i < *count; i++) {
if (strcmp(address->name, ent->ifa_name) == 0) {
+#if defined(__CYGWIN__) || defined(__MSYS__)
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
+#else
struct sockaddr_dl* sa_addr;
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
+#endif
}
address++;
}