1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-08 00:34:57 +03:00

Return and cache all addresses from DNS resolver

This commit is contained in:
Yihong Wu
2021-12-06 00:45:00 +08:00
parent a9239a6aab
commit e6bf956806
3 changed files with 146 additions and 54 deletions

View File

@ -17049,14 +17049,32 @@ bool IsMyIPAddress(IP *ip)
// Add the IP address to the list
void AddHostIPAddressToList(LIST *o, IP *ip)
{
IP *r;
IP *r = NULL;
// Validate arguments
if (o == NULL || ip == NULL)
{
return;
}
r = Search(o, ip);
if (o->cmp != NULL)
{
r = Search(o, ip);
}
else
{
UINT i;
for (i = 0; i < LIST_NUM(o); i++)
{
IP *a = LIST_DATA(o, i);
if (CmpIpAddr(ip, a) == 0)
{
r = ip;
break;
}
}
}
if (r != NULL)
{
return;
@ -17219,7 +17237,7 @@ LIST *CloneIPAddressList(LIST *o)
return NULL;
}
ret = NewListFast(CmpIpAddressList);
ret = NewListFast(o->cmp);
for (i = 0; i < LIST_NUM(o); i++)
{