mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 05:09:14 +00:00
Change o.TimeSinceStartMS returning milliseconds to o.TimeSinceStart
returning floating-point seconds. Everywhere o.TimeSinceStartMS was called, the return value was being divided by 1000.0, which had the same effect but would overflow when the difference exceeded about 25 days (2^31 milliseconds). This patch is by Daniel Miller.
This commit is contained in:
@@ -523,7 +523,7 @@ public:
|
||||
resetHostIterator() afterward). Don't let this list get empty,
|
||||
then add to it again, or you may mess up nextI (I'm not sure) */
|
||||
list<HostOsScanInfo *> incompleteHosts;
|
||||
unsigned int starttimems;
|
||||
float starttime;
|
||||
|
||||
unsigned int numIncompleteHosts() {return incompleteHosts.size();}
|
||||
HostOsScanInfo *findIncompleteHost(struct sockaddr_storage *ss);
|
||||
@@ -2886,7 +2886,7 @@ int OsScanInfo::removeCompletedHosts() {
|
||||
if (remain && !timedout)
|
||||
log_write(LOG_STDOUT, "Completed os scan against %s in %.3fs (%d %s)\n",
|
||||
hsi->target->targetipstr(),
|
||||
(o.TimeSinceStartMS() - this->starttimems) / 1000.0, remain,
|
||||
o.TimeSinceStart() - this->starttime, remain,
|
||||
(remain == 1)? "host left" : "hosts left");
|
||||
else if (timedout)
|
||||
log_write(LOG_STDOUT, "%s timed out during os scan (%d %s)\n",
|
||||
@@ -3747,7 +3747,7 @@ static int os_scan_2(vector<Target *> &Targets) {
|
||||
delete OSI;
|
||||
return 1;
|
||||
}
|
||||
OSI->starttimems = o.TimeSinceStartMS();
|
||||
OSI->starttime = o.TimeSinceStart();
|
||||
|
||||
HOS = new HostOsScan(Targets[0]);
|
||||
startTimeOutClocks(OSI);
|
||||
|
||||
Reference in New Issue
Block a user