Browse Source

Merge branch 'dev' of github.com:/zerotier/ZeroTierOne into dev

Adam Ierymenko 2 years ago
parent
commit
b0aae380e9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      osdep/Binder.hpp

+ 3 - 3
osdep/Binder.hpp

@@ -42,7 +42,7 @@
 
 
 #if (defined(__unix__) || defined(__APPLE__)) && !defined(__LINUX__) && !defined(ZT_SDK)
 #if (defined(__unix__) || defined(__APPLE__)) && !defined(__LINUX__) && !defined(ZT_SDK)
 #include <net/if.h>
 #include <net/if.h>
-#if ! defined(TARGET_OS_IOS)
+#if defined(TARGET_OS_OSX)
 #include <netinet6/in6_var.h>
 #include <netinet6/in6_var.h>
 #endif
 #endif
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
@@ -333,7 +333,7 @@ class Binder {
 					while (ifa) {
 					while (ifa) {
 						if ((ifa->ifa_name) && (ifa->ifa_addr)) {
 						if ((ifa->ifa_name) && (ifa->ifa_addr)) {
 							InetAddress ip = *(ifa->ifa_addr);
 							InetAddress ip = *(ifa->ifa_addr);
-#if (defined(__unix__) || defined(__APPLE__)) && !defined(__LINUX__) && !defined(ZT_SDK) && !defined(TARGET_OS_IOS)
+#if (defined(__unix__) || defined(__APPLE__)) && !defined(__LINUX__) && !defined(ZT_SDK) && defined(TARGET_OS_OSX)
 							// Check if the address is an IPv6 Temporary Address, macOS/BSD version
 							// Check if the address is an IPv6 Temporary Address, macOS/BSD version
 							if (ifa->ifa_addr->sa_family == AF_INET6) {
 							if (ifa->ifa_addr->sa_family == AF_INET6) {
 								struct sockaddr_in6* sa6 = (struct sockaddr_in6*)ifa->ifa_addr;
 								struct sockaddr_in6* sa6 = (struct sockaddr_in6*)ifa->ifa_addr;
@@ -349,8 +349,8 @@ class Binder {
 
 
 								// if this is a temporary IPv6 address, skip to the next address
 								// if this is a temporary IPv6 address, skip to the next address
 								if (flags & IN6_IFF_TEMPORARY) {
 								if (flags & IN6_IFF_TEMPORARY) {
-									char buf[64];
 #ifdef ZT_TRACE
 #ifdef ZT_TRACE
+									char buf[64];
 									fprintf(stderr, "skip binding to temporary IPv6 address: %s\n", ip.toIpString(buf));
 									fprintf(stderr, "skip binding to temporary IPv6 address: %s\n", ip.toIpString(buf));
 #endif
 #endif
 									ifa = ifa->ifa_next;
 									ifa = ifa->ifa_next;