summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/resolv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index aa81bebed..c05f18980 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1746,6 +1746,9 @@ int getnameinfo(const struct sockaddr *sa,
if (sa == NULL || addrlen < sizeof(sa_family_t))
return EAI_FAMILY;
+ if ((flags & NI_NAMEREQD) && host == NULL && serv == NULL)
+ return EAI_NONAME;
+
if (sa->sa_family == AF_LOCAL) /* valid */;
#ifdef __UCLIBC_HAS_IPV4__
else if (sa->sa_family == AF_INET) {