mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Short-circuit HostScanStats::completed in host discovery: once we know the host
is up or down, we can move it to the completed list, regardless of any active probes. However I can imagine changing this so that we move it when it is found up, or when it is found down and there are no probes left to send. That would give a down host a chance to become up with a different probe later on.
This commit is contained in:
parent
b0b0c0926a
commit
6998d72ccc
1 changed files with 6 additions and 6 deletions
|
|
@ -2172,18 +2172,18 @@ void HostScanStats::markProbeTimedout(list<UltraProbe *>::iterator probeI) {
|
|||
}
|
||||
|
||||
bool HostScanStats::completed() {
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/* 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 other types of scan, we are done when there are no more ports to
|
||||
probe. */
|
||||
return freshPortsLeft() == 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue