1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Add debug info with getaddrinfo error

This commit is contained in:
dmiller
2017-10-04 18:27:30 +00:00
parent f4b7c6f09d
commit 358d221aa3

View File

@@ -484,8 +484,11 @@ struct addrinfo *resolve_all(const char *hostname, int pf) {
/* Otherwise we get multiple identical addresses with different socktypes. */
hints.ai_socktype = SOCK_DGRAM;
rc = getaddrinfo(hostname, NULL, &hints, &result);
if (rc != 0)
if (rc != 0){
if (o.debugging > 1)
error("Error resolving %s: %s", hostname, gai_strerror(rc));
return NULL;
}
return result;
}