libevent/evdns-internal.h
CXD d6dbd7f818
Windows platform supports reading IPv6 addresses for DNS server. (#1701)
When using libevent on the Windows platform in an IPv6 environment, I found that libevent could not read the DNS server address for IPv6 addresses during DNS initialization, resulting in constant DNS resolution failures. Then, on MSDN, I discovered that the GetNetworkParams interface does not support obtaining IPv6 addresses, and they provided another interface, GetAdaptersAddresses, to obtain both IPv4 and IPv6 addresses. Therefore, I replaced the GetNetworkParams interface with the GetAdaptersAddresses interface. Please review whether this modification can be merged into the master branch.

Reference MSDN documentation:
https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getnetworkparams
https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses

Co-authored-by: alphacheng <alphacheng@tencent.com>
Co-authored-by: Azat Khuzhin <azat@libevent.org>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
2024-11-02 18:26:59 +01:00

23 lines
300 B
C

#ifndef EVDNS_INTERNAL_H_INCLUDED_
#define EVDNS_INTERNAL_H_INCLUDED_
#ifdef __cplusplus
extern "C" {
#endif
#include "event2/event_struct.h"
#ifdef _WIN32
EVENT2_EXPORT_SYMBOL
int load_nameservers_with_getadaptersaddresses(struct evdns_base *base);
#endif
#ifdef __cplusplus
}
#endif
#endif