Keep softmatch on connect error. Fixes #3602. Closes #3487
Some checks failed
nmap multiplatform autobuilds / build (arm64, gcc, ubuntu-latest-gcc-arm64, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, freebsd-15-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, macos-15-clang, macos-15) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, macos-26-clang, macos-26) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, netbsd-10-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, openbsd-7-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, solaris-11-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (clang, ubuntu-latest-clang, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (egcc, openbsd-7-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, freebsd-15-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, netbsd-10-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, solaris-11-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (gcc, ubuntu-latest-gcc, ubuntu-latest) (push) Has been cancelled
nmap multiplatform autobuilds / build (msvc, windows-latest-msvc, windows-latest) (push) Has been cancelled

This commit is contained in:
dmiller 2026-11-24 17:18:05 +00:00
parent d058258800
commit 4568fbc1b8
2 changed files with 8 additions and 1 deletions

View file

@ -1,5 +1,9 @@
#Nmap Changelog ($Id$); -*-text-*-
o [GH#3602][GH#3487] Fixed an issue where a connection failure in service scan
would cause Nmap to drop an existing softmatch classification for that
service. [Martin Desrumaux]
o [GH#3603] Fixed the issue where the same source port number was used for all
service probes to a given target, resulting in EADDRNOTAVAIL in some cases.

View file

@ -2405,7 +2405,10 @@ static void servicescan_connect_handler(nsock_pool nsp, nsock_event nse, void *m
// and move it to the finished bin.
if (o.debugging)
error("Got nsock CONNECT response with status %s - aborting this service", nse_status2str(status));
end_svcprobe(PROBESTATE_INCOMPLETE, SG, svc, nsi);
/* A softmatch from an earlier probe is still valid: a failure to open
a further connection says nothing about what already answered. */
end_svcprobe(svc->softMatchFound ? PROBESTATE_FINISHED_SOFTMATCHED
: PROBESTATE_INCOMPLETE, SG, svc, nsi);
break;
case NSE_STATUS_KILL: