mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-08 00:34:57 +03:00
Fix DNS resolution when no IPv6 address is configured
This commit is contained in:
@ -9871,6 +9871,36 @@ bool IsIPv6Supported()
|
||||
#endif // NO_IPV6
|
||||
}
|
||||
|
||||
// Check whether an IPv6 address is configured on any interface
|
||||
bool HasIPv6Address()
|
||||
{
|
||||
LIST *o;
|
||||
UINT i;
|
||||
bool ret = false;
|
||||
|
||||
o = GetHostIPAddressList();
|
||||
|
||||
ret = false;
|
||||
|
||||
for (i = 0; i < LIST_NUM(o); i++)
|
||||
{
|
||||
IP *p = LIST_DATA(o, i);
|
||||
|
||||
if (IsIP6(p))
|
||||
{
|
||||
UINT type = GetIPAddrType6(p);
|
||||
if ((type & IPV6_ADDR_GLOBAL_UNICAST) && ((type & IPV6_ADDR_ZERO) == 0) && ((type & IPV6_ADDR_LOOPBACK) == 0))
|
||||
{
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FreeHostIPAddressList(o);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Add the thread to the thread waiting list
|
||||
void AddWaitThread(THREAD *t)
|
||||
{
|
||||
|
Reference in New Issue
Block a user