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

Show an error instead of silently falling back to AF_INET6.

This commit is contained in:
david
2012-11-12 19:34:23 +00:00
parent 0d3a8846b0
commit c5f632382f

View File

@@ -642,9 +642,13 @@ int main(int argc, char *argv[])
if (targetss.storage.ss_family == AF_INET) if (targetss.storage.ss_family == AF_INET)
targetss.in.sin_port = htons(o.portno); targetss.in.sin_port = htons(o.portno);
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
else else if (targetss.storage.ss_family == AF_INET6)
targetss.in6.sin6_port = htons(o.portno); targetss.in6.sin6_port = htons(o.portno);
#endif #endif
else if (targetss.storage.ss_family == AF_UNSPEC)
; /* Leave unspecified. */
else
bye("Unknown address family %d.", targetss.storage.ss_family);
if (srcport != -1) { if (srcport != -1) {
if (o.listen) { if (o.listen) {