From 7b68aaa4553347a03866f8ca302017c29b75671d Mon Sep 17 00:00:00 2001 From: david Date: Sat, 3 Jan 2009 07:06:13 +0000 Subject: [PATCH] Restore the setting of the global ping host. This was mistakenly removed (by me) in r8784 when I made the change to retain ping probes between ping scanning and port scanning. It only gets set during host discovery scans, because that's how it was before, but it might be advantageous to set it during port scans as well. --- scan_engine.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scan_engine.cc b/scan_engine.cc index 5d1fac8d7..4f4699a75 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -2614,6 +2614,14 @@ static void ultrascan_host_probe_update(UltraScanInfo *USI, HostScanStats *hss, } hss->target->pingprobe = *probe->pspec(); hss->target->pingprobe_state = PORT_UNKNOWN; + /* Make this the new global ping host, but only if the old one is not + waiting for any probes. */ + if (USI->gstats->pinghost == NULL + || USI->gstats->pinghost->probes_outstanding_empty()) { + if (o.debugging > 1) + log_write(LOG_PLAIN, "Changing global ping host to %s.\n", hss->target->targetipstr()); + USI->gstats->pinghost = hss; + } } }