Merge pull request #1542 from sortie/HOST_NOT_FOUND

Fix using HOST_NOT_FOUND instead of EAI_NONAME.
This commit is contained in:
ailin-nemui 2025-04-14 13:36:51 +00:00 committed by GitHub
commit a5441f62b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -430,7 +430,7 @@ int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
}
if (count_v4 == 0 && count_v6 == 0)
return HOST_NOT_FOUND; /* shouldn't happen? */
return EAI_NONAME; /* shouldn't happen? */
/* if there are multiple addresses, return random one */
use_v4 = count_v4 <= 1 ? 0 : rand() % count_v4;