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:
@@ -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);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user