1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 04:09:01 +00:00

Let --min-rtt-timeout be a lower bound on the initial timeout for ARP

scan. ARP scan had a hardcoded initial timeout of 100 ms, which could be
lower than the minimum requested. The default minimum timeout is also
100 ms, so this has no effect if --min-rtt-timeout is not used.
This commit is contained in:
david
2010-09-17 16:35:01 +00:00
parent 745a49d24a
commit c8106e0ef3
2 changed files with 2 additions and 2 deletions

View File

@@ -924,7 +924,7 @@ GroupScanStats::GroupScanStats(UltraScanInfo *UltraSI) {
initialize_timeout_info(&to);
/* Default timout should be much lower for arp */
if (USI->ping_scan_arp)
to.timeout = MIN(o.initialRttTimeout(), 100) * 1000;
to.timeout = MAX(o.minRttTimeout(), MIN(o.initialRttTimeout(), 100)) * 1000;
num_probes_active = 0;
numtargets = USI->numIncompleteHosts(); // They are all incomplete at the beginning
numprobes = USI->numProbesPerHost();

View File

@@ -117,7 +117,7 @@ static void arpping(Target *hostbatch[], int num_hosts) {
for (targetno = 0; targetno < num_hosts; targetno++) {
initialize_timeout_info(&hostbatch[targetno]->to);
/* Default timout should be much lower for arp */
hostbatch[targetno]->to.timeout = MIN(o.initialRttTimeout(), 100) * 1000;
hostbatch[targetno]->to.timeout = MAX(o.minRttTimeout(), MIN(o.initialRttTimeout(), 100)) * 1000;
if (!hostbatch[targetno]->SrcMACAddress()) {
bool islocal = islocalhost(hostbatch[targetno]->v4hostip());
if (islocal) {