diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-01-20 18:14:09 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-01-20 18:14:09 -0600 |
commit | 76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5 (patch) | |
tree | eaaa435435196e67cd8bcdc0332530f8966094e9 /apps/netutils/dnsclient | |
parent | 85b02aa80df6d162d17f3eaef4290c7e92a655e0 (diff) | |
download | nuttx-76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5.tar.gz nuttx-76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5.tar.bz2 nuttx-76a7272bad960a5d5abb6ec09a1aebc1e5fad1a5.zip |
Correct name of fields in struct sockaddr_in6: sin6_port and sin6_family, not sin_port and sin_family
Diffstat (limited to 'apps/netutils/dnsclient')
-rw-r--r-- | apps/netutils/dnsclient/dns_socket.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/netutils/dnsclient/dns_socket.c b/apps/netutils/dnsclient/dns_socket.c index 76cf64a33..693aae7f7 100644 --- a/apps/netutils/dnsclient/dns_socket.c +++ b/apps/netutils/dnsclient/dns_socket.c @@ -546,12 +546,15 @@ void dns_setserver(FAR const struct in6_addr *dnsserver) void dns_setserver(FAR const struct in_addr *dnsserver) #endif { - g_dnsserver.sin_family = AF_INET; - g_dnsserver.sin_port = HTONS(53); - #ifdef CONFIG_NETUTILS_DNSCLIENT_IPv6 + g_dnsserver.sin6_family = AF_INET6; + g_dnsserver.sin6_port = HTONS(53); + memcpy(&g_dnsserver.sin6_addr, dnsserver, ADDRLEN); #else + g_dnsserver.sin_family = AF_INET; + g_dnsserver.sin_port = HTONS(53); + g_dnsserver.sin_addr.s_addr = dnsserver->s_addr; #endif } |