瀏覽代碼

Added preprocessor check for __APPLE__ as an attempted fix for ticket #600

Joseph Henry 6 年之前
父節點
當前提交
c6ae81fac7
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 1
      osdep/Binder.hpp
  2. 2 0
      service/OneService.cpp

+ 1 - 1
osdep/Binder.hpp

@@ -373,7 +373,7 @@ public:
 				tcps = phy.tcpListen(reinterpret_cast<const struct sockaddr *>(&(ii->first)),(void *)0);
 				if ((udps)&&(tcps)) {
 #ifdef __LINUX__
-					// Bind Linux sockets to their device so routes tha we manage do not override physical routes (wish all platforms had this!)
+					// Bind Linux sockets to their device so routes that we manage do not override physical routes (wish all platforms had this!)
 					if (ii->second.length() > 0) {
 						char tmp[256];
 						Utils::scopy(tmp,sizeof(tmp),ii->second.c_str());

+ 2 - 0
service/OneService.cpp

@@ -1801,12 +1801,14 @@ public:
 				bool haveRoute = false;
 
 				// Ignore routes implied by local managed IPs since adding the IP adds the route
+#ifndef __APPLE__
 				for(std::vector<InetAddress>::iterator ip(n.managedIps.begin());ip!=n.managedIps.end();++ip) {
 					if ((target->netmaskBits() == ip->netmaskBits())&&(target->containsAddress(*ip))) {
 						haveRoute = true;
 						break;
 					}
 				}
+#endif
 				if (haveRoute)
 					continue;
 #ifndef ZT_SDK