mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-01 04:26:07 +00:00
Remove deprecated vfork call on Mac, and make Mac route application more robust.
This commit is contained in:
parent
cce8411c22
commit
594853e251
@ -157,7 +157,7 @@ static int run(const char *path,...)
|
|||||||
args[argNo++] = (char *)0;
|
args[argNo++] = (char *)0;
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
pid_t pid = vfork();
|
pid_t pid = fork();
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (pid == 0) {
|
} else if (pid == 0) {
|
||||||
|
@ -507,15 +507,15 @@ bool ManagedRoute::sync()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_applied.count(leftt)) {
|
//if (!_applied.count(leftt)) {
|
||||||
_applied[leftt] = !_via;
|
_applied[leftt] = !_via;
|
||||||
_routeCmd("delete",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
//_routeCmd("delete",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
||||||
_routeCmd("add",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
_routeCmd("add",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
||||||
//_routeCmd("change",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
//_routeCmd("change",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
||||||
}
|
//}
|
||||||
if ((rightt)&&(!_applied.count(rightt))) {
|
if (rightt) {
|
||||||
_applied[rightt] = !_via;
|
_applied[rightt] = !_via;
|
||||||
_routeCmd("delete",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
//_routeCmd("delete",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
||||||
_routeCmd("add",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
_routeCmd("add",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
||||||
//_routeCmd("change",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
//_routeCmd("change",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user