1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 00:19:01 +00:00

Make resolve return a getaddrinfo error code.

The only error we can have apart from a getaddrinfo error is a list of
zero addresses; return EAI_NONAME in that case.

This unfortunately inverts the truth value of the return code of
resolve; 0 now means success.
This commit is contained in:
david
2012-09-15 17:56:08 +00:00
parent 8803578976
commit 0e738370ee
10 changed files with 34 additions and 30 deletions

View File

@@ -164,7 +164,7 @@ int parse_ip_options(const char *txt, u8 *data, int datalen, int* firsthopoff, i
- Parameter "nodns": If set, it means that the supplied hostname is actually a
numeric IP address. The flag prevents any type of name resolution service
from being called. In 99% of the cases this should be 0.
Returns 1 on success or 0 if hostname could not be resolved. */
Returns 0 on success, or a getaddrinfo return code on failure. */
int resolve(const char *hostname, u16 port, int nodns, struct sockaddr_storage *ss, size_t *sslen, int af);
/*