1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Replace nested MAX/MIN macros with box() function

This commit is contained in:
dmiller
2024-06-27 19:36:05 +00:00
parent dcb4ba569e
commit 1ec9caea3b
4 changed files with 7 additions and 5 deletions

View File

@@ -91,10 +91,11 @@ static void arpping(Target *hostbatch[], int num_hosts) {
int targetno;
targets.reserve(num_hosts);
/* Default timout should be much lower for arp */
int default_to = box(o.minRttTimeout(), o.initialRttTimeout(), INITIAL_ARP_RTT_TIMEOUT) * 1000;
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 = MAX(o.minRttTimeout(), MIN(o.initialRttTimeout(), INITIAL_ARP_RTT_TIMEOUT)) * 1000;
hostbatch[targetno]->to.timeout = default_to;
if (!hostbatch[targetno]->SrcMACAddress()) {
bool islocal = islocalhost(hostbatch[targetno]->TargetSockAddr());
if (islocal) {