libc/netdb: Fix some compile issues when IPv6 is enabled
This commit is contained in:
parent
e4e6181098
commit
6af9b23df5
@ -190,7 +190,7 @@ static int dns_send_query(int sd, FAR const char *name,
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (uaddr->addr.sa_family == AF_INET)
|
||||
if (uaddr->ipv4.sin_family == AF_INET)
|
||||
#endif
|
||||
{
|
||||
addrlen = sizeof(struct sockaddr_in);
|
||||
@ -521,7 +521,7 @@ static int dns_query_callback(FAR void *arg, FAR struct sockaddr *addr,
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
/* Is this an IPv4 address? */
|
||||
|
||||
if (query->addr.sa_family == AF_INET6)
|
||||
if (query->addr->sa_family == AF_INET6)
|
||||
{
|
||||
/* Yes.. verify the address size */
|
||||
|
||||
|
@ -382,7 +382,7 @@ static int lib_find_answer(FAR const char *name, FAR struct hostent *host,
|
||||
DEBUGASSERT(addrlen == sizeof(struct sockaddr_in6));
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
addrtype = AF_INET6;
|
||||
addrdata = &((FAR struct sockaddr_in6 *)ptr)->sin_addr;
|
||||
addrdata = &((FAR struct sockaddr_in6 *)ptr)->sin6_addr;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -524,7 +524,7 @@ static int lib_dns_lookup(FAR const char *name, FAR struct hostent *host,
|
||||
DEBUGASSERT(addrlen == sizeof(struct sockaddr_in6));
|
||||
addrlen = sizeof(struct sockaddr_in6);
|
||||
addrtype = AF_INET6;
|
||||
addrdata = &((FAR struct sockaddr_in6 *)ptr)->sin_addr;
|
||||
addrdata = &((FAR struct sockaddr_in6 *)ptr)->sin6_addr;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user