1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 12:59:02 +00:00

Ncat supports DNS failover, including fallback to IPv4 from IPv6

This commit is contained in:
dmiller
2017-03-16 21:54:26 +00:00
parent bbfb5dfed6
commit 4629f6d836
8 changed files with 223 additions and 97 deletions

View File

@@ -510,7 +510,7 @@ int do_connect(int type)
/* We need a socket that can be inherited by child processes in
ncat_exec_win.c, for --exec and --sh-exec. inheritable_socket is from
nbase. */
sock = inheritable_socket(targetss.storage.ss_family, type, 0);
sock = inheritable_socket(targetaddrs->addr.storage.ss_family, type, 0);
if (srcaddr.storage.ss_family != AF_UNSPEC) {
size_t sa_len;
@@ -527,7 +527,7 @@ int do_connect(int type)
}
if (sock != -1) {
if (connect(sock, &targetss.sockaddr, (int) targetsslen) != -1)
if (connect(sock, &targetaddrs->addr.sockaddr, (int) targetaddrs->addrlen) != -1)
return sock;
else if (socket_errno() == EINPROGRESS || socket_errno() == EAGAIN)
return sock;