mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
d6dbd7f818
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>
23 lines
300 B
C
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
|
|
|