diff options
Diffstat (limited to 'apps/netutils')
-rw-r--r-- | apps/netutils/dnsclient/dns_socket.c | 9 | ||||
-rw-r--r-- | apps/netutils/netlib/netlib_setdripv6addr.c | 6 | ||||
-rw-r--r-- | apps/netutils/netlib/netlib_setipv6addr.c | 6 | ||||
-rw-r--r-- | apps/netutils/netlib/netlib_setipv6netmask.c | 6 |
4 files changed, 15 insertions, 12 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 } diff --git a/apps/netutils/netlib/netlib_setdripv6addr.c b/apps/netutils/netlib/netlib_setdripv6addr.c index d339e6b87..aed620b0b 100644 --- a/apps/netutils/netlib/netlib_setdripv6addr.c +++ b/apps/netutils/netlib/netlib_setdripv6addr.c @@ -90,9 +90,9 @@ int netlib_set_dripv6addr(FAR const char *ifname, /* Add the INET address to the request */ - inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; - inaddr->sin_family = AF_INET6; - inaddr->sin_port = 0; + inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; + inaddr->sin6_family = AF_INET6; + inaddr->sin6_port = 0; memcpy(&inaddr->sin6_addr, addr, sizeof(struct in6_addr)); ret = ioctl(sockfd, SIOCSLIFDSTADDR, (unsigned long)((uintptr_t)&req)); diff --git a/apps/netutils/netlib/netlib_setipv6addr.c b/apps/netutils/netlib/netlib_setipv6addr.c index 8a5d8be80..e4d4c179a 100644 --- a/apps/netutils/netlib/netlib_setipv6addr.c +++ b/apps/netutils/netlib/netlib_setipv6addr.c @@ -90,9 +90,9 @@ int netlib_set_ipv6addr(FAR const char *ifname, /* Add the INET address to the request */ - inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; - inaddr->sin_family = AF_INET6; - inaddr->sin_port = 0; + inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; + inaddr->sin6_family = AF_INET6; + inaddr->sin6_port = 0; memcpy(&inaddr->sin6_addr, addr, sizeof(struct in6_addr)); ret = ioctl(sockfd, SIOCSLIFADDR, ((unsigned long)(uintptr_t)&req)); diff --git a/apps/netutils/netlib/netlib_setipv6netmask.c b/apps/netutils/netlib/netlib_setipv6netmask.c index f092790a2..fc9d67f37 100644 --- a/apps/netutils/netlib/netlib_setipv6netmask.c +++ b/apps/netutils/netlib/netlib_setipv6netmask.c @@ -89,9 +89,9 @@ int netlib_set_ipv6netmask(FAR const char *ifname, /* Add the INET address to the request */ - inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; - inaddr->sin_family = AF_INET6; - inaddr->sin_port = 0; + inaddr = (FAR struct sockaddr_in6 *)&req.lifr_addr; + inaddr->sin6_family = AF_INET6; + inaddr->sin6_port = 0; memcpy(&inaddr->sin6_addr, addr, sizeof(struct in6_addr)); ret = ioctl(sockfd, SIOCSLIFNETMASK, (unsigned long)((uintptr_t)&req)); |