1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 08:59:01 +00:00

Set timeouts for Windows connect scan. Fixes #2113

This commit is contained in:
dmiller
2024-10-30 19:02:09 +00:00
parent f1559fbc22
commit 0e3a51c992
3 changed files with 65 additions and 4 deletions

View File

@@ -2639,6 +2639,16 @@ static void processData(UltraScanInfo *USI) {
probe = *probeI;
unsigned long to_us = host->probeTimeout();
#ifdef WIN32
if (USI->scantype == CONNECT_SCAN || USI->ptech.connecttcpscan) {
// Have to adjust to_us up because of TCP_MAXRT granularity
if (USI->has_tcp_maxrtms) {
to_us += (1000 - to_us % 1000);
} else {
to_us += (1000000 - to_us % 1000000);
}
}
#endif
long probe_age_us = TIMEVAL_SUBTRACT(USI->now, probe->sent);
// give up completely after this long
expire_us = host->probeExpireTime(probe, to_us);