mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
libc/netdb: Support save the mix of IPv4/IPv6 address into hostent
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I704d38afde14b6d90a7726096fd1f483f96ba237
This commit is contained in:
@@ -287,7 +287,7 @@ int getaddrinfo(FAR const char *hostname, FAR const char *servname,
|
||||
{
|
||||
for (i = 0; hp->h_addr_list[i]; i++)
|
||||
{
|
||||
if (family != AF_UNSPEC && hp->h_addrtype != family)
|
||||
if (family != AF_UNSPEC && hp->h_addrtypes[i] != family)
|
||||
{
|
||||
/* Filter by protocol family. */
|
||||
|
||||
@@ -296,7 +296,7 @@ int getaddrinfo(FAR const char *hostname, FAR const char *servname,
|
||||
|
||||
/* REVISIT: filter by socktype and protocol not implemented. */
|
||||
|
||||
ai = alloc_ai(hp->h_addrtype, socktype, proto, port,
|
||||
ai = alloc_ai(hp->h_addrtypes[i], socktype, proto, port,
|
||||
hp->h_addr_list[i]);
|
||||
if (ai == NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user