1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-30 10:09:03 +00:00

Corrects a unit-of-measure mismatch between the desired packet delay and

an observed roundtrip time. Closes #1038, closes #1037.
This commit is contained in:
nnposter
2017-10-24 17:21:22 +00:00
parent 8366c90893
commit 5fa53d064a
2 changed files with 6 additions and 6 deletions

View File

@@ -484,12 +484,9 @@ action = function(host)
-- Unlike qscan.cc which loops around while waiting for
-- the delay, I just sleep here (depending on rtt)
if rtt < (3 * delay) / 2 then
if rtt < (delay / 2) then
stdnse.sleep(((delay / 2) + math.random(0, delay) - rtt))
else
stdnse.sleep(math.random((3 * delay) / 2 - rtt))
end
local sleep = delay * (0.5 + math.random()) - rtt / 1000000
if sleep > 0 then
stdnse.sleep(sleep)
end
end
end