Fixed our supplied getnameinfo()'s ability to do a reverse lookup,

as reported in bug 5851.
This commit is contained in:
Wayne Davison
2008-10-25 08:39:41 -07:00
parent b3347e2a03
commit 9ddc2b64da

View File

@@ -492,13 +492,10 @@ int getnameinfo(const struct sockaddr *sa, socklen_t salen,
return EAI_FAIL;
}
/* We don't support those. */
if ((node && !(flags & NI_NUMERICHOST))
|| (service && !(flags & NI_NUMERICSERV)))
return EAI_FAIL;
if (node) {
return gethostnameinfo(sa, node, nodelen, flags);
int ret = gethostnameinfo(sa, node, nodelen, flags);
if (ret)
return ret;
}
if (service) {