mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 13:19:04 +00:00
Update timeout script-args to use standard timespec
Many scripts were documented as using timespecs (10s, 5000ms, etc) for timeout script-args, but one 1 or 2 actually did. Now all timeout script-args will accept timespecs, except those which took a number of milliseconds, which remain unchanged. Also fixed some documentation issues (missing script name in arg description, missing nsedoc for args, etc)
This commit is contained in:
@@ -137,11 +137,8 @@ end
|
||||
action = function()
|
||||
|
||||
local host, port = "255.255.255.255", 67
|
||||
local timeout = stdnse.get_script_args("broadcast-dhcp-discover.timeout")
|
||||
timeout = tonumber(timeout) or 10
|
||||
|
||||
-- convert from seconds to ms
|
||||
timeout = timeout * 1000
|
||||
local timeout = stdnse.parse_timespec(stdnse.get_script_args("broadcast-dhcp-discover.timeout"))
|
||||
timeout = (timeout or 10) * 1000
|
||||
|
||||
-- randomizing the MAC could exhaust dhcp servers with small scopes
|
||||
-- if ran multiple times, so we should probably refrain from doing
|
||||
|
||||
Reference in New Issue
Block a user