nmap/nmap-unsolicited_arp_assert.patch
DistroBaker d90e73d01d Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/nmap.git#b9eb387d2722d773d484be8d72c61ab611d9f413
2021-01-10 20:09:42 +00:00

33 lines
1.2 KiB
Diff

From 33f421fd6e68fcb8ed50071661d9704717c81b2b Mon Sep 17 00:00:00 2001
From: dmiller <dmiller@e0a8ed71-7df4-0310-8962-fdc924857419>
Date: Tue, 3 Dec 2019 17:04:13 +0000
Subject: [PATCH] Avoid assertion failure when unsolicited ARP response
received
We probably want a more explicit handling of the case where we get an
ARP response to a request that we did not send (system's own, or another
Nmap scan running at the same time). In any case, this ought to solve
the crashes reported as #1797 and #1764.
---
scan_engine.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scan_engine.cc b/scan_engine.cc
index bd73cc8ead..7a4766da26 100644
--- a/scan_engine.cc
+++ b/scan_engine.cc
@@ -1275,7 +1275,12 @@ int UltraScanInfo::removeCompletedHosts() {
}
if (timedout)
gstats->num_hosts_timedout++;
- hss->target->stopTimeOutClock(&now);
+ /* We may have received an ARP response before we sent a probe, which
+ * would mean the timeout clock is not running. Avoid an assertion
+ * failure here by checking first. */
+ if (hss->target->timeOutClockRunning()) {
+ hss->target->stopTimeOutClock(&now);
+ }
}
}
return hostsRemoved;