mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Tap driver load fix.
This commit is contained in:
parent
c9af603b9f
commit
508519b62a
1 changed files with 13 additions and 16 deletions
|
@ -344,8 +344,7 @@ OSXEthernetTap::OSXEthernetTap(
|
||||||
|
|
||||||
Mutex::Lock _gl(globalTapCreateLock);
|
Mutex::Lock _gl(globalTapCreateLock);
|
||||||
|
|
||||||
if (stat("/dev/zt0",&stattmp)) {
|
if (::stat("/dev/zt0",&stattmp)) {
|
||||||
if (homePath) {
|
|
||||||
long kextpid = (long)vfork();
|
long kextpid = (long)vfork();
|
||||||
if (kextpid == 0) {
|
if (kextpid == 0) {
|
||||||
::chdir(homePath);
|
::chdir(homePath);
|
||||||
|
@ -357,11 +356,9 @@ OSXEthernetTap::OSXEthernetTap(
|
||||||
::waitpid(kextpid,&exitcode,0);
|
::waitpid(kextpid,&exitcode,0);
|
||||||
}
|
}
|
||||||
::usleep(500); // give tap device driver time to start up and try again
|
::usleep(500); // give tap device driver time to start up and try again
|
||||||
if (stat("/dev/zt0",&stattmp))
|
if (::stat("/dev/zt0",&stattmp))
|
||||||
throw std::runtime_error("/dev/zt# tap devices do not exist and cannot load tap.kext");
|
throw std::runtime_error("/dev/zt# tap devices do not exist and cannot load tap.kext");
|
||||||
}
|
}
|
||||||
throw std::runtime_error("/dev/zt# tap devices do not exist and tap.kext not available");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to reopen the last device we had, if we had one and it's still unused.
|
// Try to reopen the last device we had, if we had one and it's still unused.
|
||||||
bool recalledDevice = false;
|
bool recalledDevice = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue