mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
removed some unnecessary locals
This commit is contained in:
@@ -404,13 +404,11 @@ hostrule = function(host)
|
|||||||
end
|
end
|
||||||
|
|
||||||
action = function(host)
|
action = function(host)
|
||||||
local i, j, k
|
|
||||||
local sock = nmap.new_dnet()
|
local sock = nmap.new_dnet()
|
||||||
local pcap = nmap.new_socket()
|
local pcap = nmap.new_socket()
|
||||||
local ports = nmap.registry[host.ip]['qscanports']
|
local ports = nmap.registry[host.ip]['qscanports']
|
||||||
local saddr = packet.toip(host.bin_ip_src)
|
local saddr = packet.toip(host.bin_ip_src)
|
||||||
local daddr = packet.toip(host.bin_ip)
|
local daddr = packet.toip(host.bin_ip)
|
||||||
local port
|
|
||||||
local start
|
local start
|
||||||
local rtt
|
local rtt
|
||||||
local stats = {}
|
local stats = {}
|
||||||
@@ -434,11 +432,8 @@ action = function(host)
|
|||||||
|
|
||||||
local tcp = genericpkt(host)
|
local tcp = genericpkt(host)
|
||||||
|
|
||||||
i = 1
|
for i = 1, numtrips do
|
||||||
|
for j, port in ipairs(ports) do
|
||||||
while i <= numtrips do
|
|
||||||
for j, _ in ipairs(ports) do
|
|
||||||
port = ports[j]
|
|
||||||
|
|
||||||
updatepkt(tcp, port)
|
updatepkt(tcp, port)
|
||||||
|
|
||||||
@@ -487,16 +482,12 @@ action = function(host)
|
|||||||
-- the delay, I just sleep here (depending on rtt)
|
-- the delay, I just sleep here (depending on rtt)
|
||||||
if rtt < (3 * delay) / 2 then
|
if rtt < (3 * delay) / 2 then
|
||||||
if rtt < (delay / 2) then
|
if rtt < (delay / 2) then
|
||||||
k = ((delay / 2) + math.random(0, delay) - rtt)
|
stdnse.sleep(((delay / 2) + math.random(0, delay) - rtt))
|
||||||
else
|
else
|
||||||
k = math.random((3 * delay) / 2 - rtt)
|
stdnse.sleep(math.random((3 * delay) / 2 - rtt))
|
||||||
end
|
end
|
||||||
|
|
||||||
stdnse.sleep(k)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
i = i + 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sock:ip_close()
|
sock:ip_close()
|
||||||
|
|||||||
Reference in New Issue
Block a user