diff --git a/scan_engine.cc b/scan_engine.cc index 463947ee2..ba6100472 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -2169,18 +2169,18 @@ void HostScanStats::markProbeTimedout(list::iterator probeI) { } bool HostScanStats::completed() { - /* With ping scan, we are done once we know the host is up or down. */ - if (USI->ping_scan && ((target->flags & HOST_UP) - || (target->flags & HOST_DOWN) || target->weird_responses)) { - return true; - } - /* If there are probes active or awaiting retransmission, we are not done. */ if (num_probes_active != 0 || num_probes_waiting_retransmit != 0 || !probe_bench.empty() || !retry_stack.empty()) { return false; } + /* With ping scan, we are done once we know the host is up or down. */ + if (USI->ping_scan && ((target->flags & HOST_UP) + || (target->flags & HOST_DOWN) || target->weird_responses)) { + return true; + } + /* With other types of scan, we are done when there are no more ports to probe. */ return freshPortsLeft() == 0;