diff options
author | Grant Limberg <grant.limberg@zerotier.com> | 2018-10-23 13:21:25 -0700 |
---|---|---|
committer | Grant Limberg <grant.limberg@zerotier.com> | 2018-10-23 13:21:25 -0700 |
commit | 7c726533850eb0a6f3a40d72f42bd50a8e93e621 (patch) | |
tree | 8e3742663b1d27ee694b8fcd456c2e67ec4cdc6e /node | |
parent | 7dbccf08aeccab18be5fb24e90a6a1d89248aa3a (diff) | |
download | infinitytier-7c726533850eb0a6f3a40d72f42bd50a8e93e621.tar.gz infinitytier-7c726533850eb0a6f3a40d72f42bd50a8e93e621.zip |
because Windows....
Diffstat (limited to 'node')
-rw-r--r-- | node/InetAddress.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/node/InetAddress.cpp b/node/InetAddress.cpp index 3eb5579f..54daa668 100644 --- a/node/InetAddress.cpp +++ b/node/InetAddress.cpp @@ -142,11 +142,19 @@ char *InetAddress::toIpString(char buf[64]) const buf[0] = (char)0; switch(ss_family) { case AF_INET: { +#ifdef _WIN32 + inet_ntop(AF_INET, (void*)&reinterpret_cast<const struct sockaddr_in *>(this)->sin_addr.s_addr, buf, INET_ADDRSTRLEN); +#else inet_ntop(AF_INET, &reinterpret_cast<const struct sockaddr_in *>(this)->sin_addr.s_addr, buf, INET_ADDRSTRLEN); +#endif } break; case AF_INET6: { +#ifdef _WIN32 + inet_ntop(AF_INET6, (void*)reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_addr.s6_addr, buf, INET6_ADDRSTRLEN); +#else inet_ntop(AF_INET6, reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_addr.s6_addr, buf, INET6_ADDRSTRLEN); +#endif } break; } return buf; |