diff --git a/libs/libc/netdb/lib_dnsaddserver.c b/libs/libc/netdb/lib_dnsaddserver.c index 4bad46ba78..9b768a1ca5 100644 --- a/libs/libc/netdb/lib_dnsaddserver.c +++ b/libs/libc/netdb/lib_dnsaddserver.c @@ -147,8 +147,7 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, socklen_t addrlen) else #endif { - nerr("ERROR: Unsupported family: %d\n", - g_dns_server.addr.sa_family); + nerr("ERROR: Unsupported family: %d\n", addr->sa_family); ret = -ENOSYS; goto errout; } diff --git a/libs/libc/netdb/lib_dnsforeach.c b/libs/libc/netdb/lib_dnsforeach.c index 4d80c09729..0772dd6307 100644 --- a/libs/libc/netdb/lib_dnsforeach.c +++ b/libs/libc/netdb/lib_dnsforeach.c @@ -224,7 +224,7 @@ int dns_foreach_nameserver(dns_callback_t callback, FAR void *arg) else #endif { - nerr("ERROR: Unrecognized address: %s\n", addrstr) + nerr("ERROR: Unrecognized address: %s\n", addrstr); ret = OK; } #ifdef CONFIG_NET_IPv6