Merge pull request #1827 from zerotier/default-route-mac2

Prevent shadowing VM routes as default route (macOS)
This commit is contained in:
Adam Ierymenko 2023-01-04 11:48:54 -05:00 committed by GitHub
commit ed53b62f1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -477,7 +477,7 @@ bool ManagedRoute::sync()
if ((newSystemVia)&&(!newSystemDevice[0])) {
rtes = _getRTEs(newSystemVia,true);
for(std::vector<_RTE>::iterator r(rtes.begin());r!=rtes.end();++r) {
if ( (r->device[0]) && (strcmp(r->device,_device) != 0) ) {
if ( (r->device[0]) && (strcmp(r->device,_device) != 0) && r->target.netmaskBits() != 0) {
Utils::scopy(newSystemDevice,sizeof(newSystemDevice),r->device);
break;
}