mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Another attempt at a fix for all the Windows driver coma issues.
This commit is contained in:
parent
25a067c8c3
commit
56285ec0d4
1 changed files with 10 additions and 7 deletions
|
@ -692,17 +692,20 @@ void WindowsEthernetTap::threadMain()
|
||||||
ULONGLONG tc = GetTickCount64();
|
ULONGLONG tc = GetTickCount64();
|
||||||
if ((tc - timeOfLastBorkCheck) >= 2500) {
|
if ((tc - timeOfLastBorkCheck) >= 2500) {
|
||||||
timeOfLastBorkCheck = tc;
|
timeOfLastBorkCheck = tc;
|
||||||
MIB_IF_TABLE2 *ift = NULL;
|
char aabuf[16384];
|
||||||
if ((GetIfTable2(&ift) == NO_ERROR)&&(ift)) {
|
ULONG aalen = sizeof(aabuf);
|
||||||
|
if (GetAdaptersAddresses(AF_UNSPEC,GAA_FLAG_SKIP_UNICAST|GAA_FLAG_SKIP_ANYCAST|GAA_FLAG_SKIP_MULTICAST|GAA_FLAG_SKIP_DNS_SERVER|GAA_FLAG_SKIP_FRIENDLY_NAME,(void *)0,reinterpret_cast<PIP_ADAPTER_ADDRESSES>(aabuf),&aalen) == NO_ERROR) {
|
||||||
bool isBorked = false;
|
bool isBorked = false;
|
||||||
for(ULONG r=0;r<ift->NumEntries;++r) {
|
|
||||||
if (ift->Table[r].InterfaceLuid.Value == _deviceLuid.Value) {
|
PIP_ADAPTER_ADDRESSES aa = reinterpret_cast<PIP_ADAPTER_ADDRESSES>(aabuf);
|
||||||
if ((ift->Table[r].InterfaceAndOperStatusFlags.NotMediaConnected)||(ift->Table[r].MediaConnectState == MediaConnectStateDisconnected))
|
while (aa) {
|
||||||
isBorked = true;
|
if (_deviceLuid.Value == aa->Luid.Value) {
|
||||||
|
isBorked = (aa->OperStatus != IfOperStatusUp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
aa = aa->Next;
|
||||||
}
|
}
|
||||||
FreeMibTable(ift);
|
|
||||||
if (isBorked) {
|
if (isBorked) {
|
||||||
// Close and reopen tap device if there's an issue (outer loop)
|
// Close and reopen tap device if there's an issue (outer loop)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue