mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Add debug info with getaddrinfo error
This commit is contained in:
5
tcpip.cc
5
tcpip.cc
@@ -484,8 +484,11 @@ struct addrinfo *resolve_all(const char *hostname, int pf) {
|
|||||||
/* Otherwise we get multiple identical addresses with different socktypes. */
|
/* Otherwise we get multiple identical addresses with different socktypes. */
|
||||||
hints.ai_socktype = SOCK_DGRAM;
|
hints.ai_socktype = SOCK_DGRAM;
|
||||||
rc = getaddrinfo(hostname, NULL, &hints, &result);
|
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 NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user