-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Labels
Description
The commit #923 made the library rely on the function if_nametoindex
, adding this made the library dependant on another windows library Iphlpapi.lib, the issue with this, is that this function is available only since windows vista, so on xp it won't work (and this library still offers support for that), this funciton should be loaded/checked at runtime like GetAdaptersAddresses
(from the same dll) is being handled here
Lines 887 to 905 in 2287217
#elif defined(_WIN32) | |
/* Windows XP began to provide GetAdaptersAddresses. Windows 2000 had a | |
"GetAdaptersInfo", but that's deprecated; let's just try | |
GetAdaptersAddresses and fall back to connect+getsockname. | |
*/ | |
HMODULE lib = evutil_load_windows_system_library_(TEXT("iphlpapi.dll")); | |
GetAdaptersAddresses_fn_t fn; | |
ULONG size, res; | |
IP_ADAPTER_ADDRESSES *addresses = NULL, *address; | |
int result = -1; | |
#define FLAGS (GAA_FLAG_SKIP_ANYCAST | \ | |
GAA_FLAG_SKIP_MULTICAST | \ | |
GAA_FLAG_SKIP_DNS_SERVER) | |
if (!lib) | |
goto done; | |
if (!(fn = (GetAdaptersAddresses_fn_t) GetProcAddress(lib, "GetAdaptersAddresses"))) |