mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Windows build warning removal, be more defensive in Windows tap driver code, and clean up service start/stop in installer.
This commit is contained in:
parent
68cb7ad4cd
commit
c7eb5f0c81
3 changed files with 13 additions and 13 deletions
|
@ -594,7 +594,10 @@ void WindowsEthernetTap::threadMain()
|
|||
|
||||
Utils::snprintf(tapPath,sizeof(tapPath),"\\\\.\\Global\\%s.tap",_netCfgInstanceId.c_str());
|
||||
int prevTapResetStatus = _systemTapResetStatus;
|
||||
bool throwOneAway = true; // "Power cycle" the network port once on startup, because Windows...
|
||||
while (_run) {
|
||||
Sleep(500);
|
||||
|
||||
_tap = CreateFileA(tapPath,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_SYSTEM|FILE_FLAG_OVERLAPPED,NULL);
|
||||
if (_tap == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr,"Error opening %s -- retrying.\r\n",tapPath);
|
||||
|
@ -698,7 +701,8 @@ void WindowsEthernetTap::threadMain()
|
|||
ReadFile(_tap,tapReadBuf,sizeof(tapReadBuf),NULL,&tapOvlRead);
|
||||
bool writeInProgress = false;
|
||||
while (_run) {
|
||||
if (prevTapResetStatus != _systemTapResetStatus) {
|
||||
if ((prevTapResetStatus != _systemTapResetStatus)||(throwOneAway)) {
|
||||
throwOneAway = false;
|
||||
prevTapResetStatus = _systemTapResetStatus;
|
||||
break; // this will cause us to close and reopen the tap
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue