1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 21:51:28 +00:00

Add a symbolic constant for INITIAL_ARP_RTT_TIMEOUT.

This commit is contained in:
david
2010-09-17 16:46:09 +00:00
parent c8106e0ef3
commit fc9d35fed9
3 changed files with 3 additions and 2 deletions

1
nmap.h
View File

@@ -320,6 +320,7 @@ void *realloc();
#endif #endif
#define INITIAL_RTT_TIMEOUT 1000 /* Allow 1 second initially for packet responses */ #define INITIAL_RTT_TIMEOUT 1000 /* Allow 1 second initially for packet responses */
#define INITIAL_ARP_RTT_TIMEOUT 100 /* The initial timeout for ARP is lower */
#ifndef MAX_RETRANSMISSIONS #ifndef MAX_RETRANSMISSIONS
#define MAX_RETRANSMISSIONS 10 /* 11 probes to port at maximum */ #define MAX_RETRANSMISSIONS 10 /* 11 probes to port at maximum */

View File

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

View File

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