platform_compat: фикс Windows-сборки (Ipv4IfIndex/Ipv6IfIndex отсутствуют, GetBestInterfaceEx без const)
This commit is contained in:
1 parent
f347dc8edc
commit
1ec94de852
1 file changed
+2
-2
@@ -298,7 +298,7 @@ static PIP_ADAPTER_ADDRESSES plat_win_get_adapters(ULONG family) {
|
|||||||
|
|
||||||
static PIP_ADAPTER_ADDRESSES plat_win_find_adapter(PIP_ADAPTER_ADDRESSES adapters, uint32_t ifindex) {
|
static PIP_ADAPTER_ADDRESSES plat_win_find_adapter(PIP_ADAPTER_ADDRESSES adapters, uint32_t ifindex) {
|
||||||
for (PIP_ADAPTER_ADDRESSES a = adapters; a; a = a->Next) {
|
for (PIP_ADAPTER_ADDRESSES a = adapters; a; a = a->Next) {
|
||||||
if (a->IfIndex == ifindex || a->Ipv4IfIndex == ifindex || a->Ipv6IfIndex == ifindex) return a;
|
if (a->IfIndex == ifindex) return a;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ uint32_t get_default_route_netif_index(int family) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
DWORD idx = 0;
|
DWORD idx = 0;
|
||||||
if (GetBestInterfaceEx((const SOCKADDR*)&dst, &idx) != NO_ERROR) return 0;
|
if (GetBestInterfaceEx((SOCKADDR*)&dst, &idx) != NO_ERROR) return 0;
|
||||||
return (uint32_t)idx;
|
return (uint32_t)idx;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user