Prechádzať zdrojové kódy

Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev

Adam Ierymenko 7 rokov pred
rodič
commit
8a3b698407
2 zmenil súbory, kde vykonal 3 pridanie a 25 odobranie
  1. 0 25
      osdep/ManagedRoute.cpp
  2. 3 0
      service/OneService.cpp

+ 0 - 25
osdep/ManagedRoute.cpp

@@ -477,31 +477,6 @@ bool ManagedRoute::sync()
 		}
 	}
 
-	// Detect routes previously applied by ZT that don't exist in the system's route list. Re-apply these.
-	// NOTE: The following block was added in reaction to the macOS High Sierra 10.13.2 disappearing 
-	// route issue. This comment should be removed once we're sure this block doesn't have any side-effects.
-	/*
-
-	// Commented out temporarily to test more generalized fix
-
-	bool found = false;
-	std::vector<_RTE> currRoutes(_getRTEs(_target,false));
-	for(std::vector<_RTE>::iterator r(currRoutes.begin());r!=currRoutes.end();++r) {
-		if(_target == r->target) {
-			found = true;
-			break;
-		}
-	}
-	if (!found) {
-		// erase _applied enteries
-		std::map<InetAddress, bool>::iterator rt;
-		rt = _applied.find(leftt);
-		_applied.erase(rt, _applied.end());
-		rt = _applied.find(rightt);
-		_applied.erase(rt, _applied.end());
-	}
-	*/
-
 	if (!_applied.count(leftt)) {
 		_applied[leftt] = false; // not ifscoped
 		_routeCmd("add",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device);

+ 3 - 0
service/OneService.cpp

@@ -1609,6 +1609,7 @@ public:
 				bool haveRoute = false;
 
 				// Ignore routes implied by local managed IPs since adding the IP adds the route
+				// Commented out to fix ticket #600 (disappearing routes on macOS). Remove this block when we're sure there's no side effects
 				/*
 				for(std::vector<InetAddress>::iterator ip(n.managedIps.begin());ip!=n.managedIps.end();++ip) {
 					if ((target->netmaskBits() == ip->netmaskBits())&&(target->containsAddress(*ip))) {
@@ -2278,6 +2279,8 @@ public:
 						return 0;
 				}
 			}
+		}
+		if (gbl) {
 			for(std::vector<InetAddress>::const_iterator a(gbl->begin());a!=gbl->end();++a) {
 				if (a->containsAddress(*reinterpret_cast<const InetAddress *>(remoteAddr)))
 					return 0;