mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Fix location of try/catch. The pcap/dnet variables were not in scope.
This commit is contained in:
@@ -35,12 +35,6 @@ prerule = function()
|
||||
return nmap.is_privileged()
|
||||
end
|
||||
|
||||
catch = function()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
try = nmap.new_try(catch)
|
||||
|
||||
local function get_interfaces()
|
||||
local interface_name = stdnse.get_script_args(SCRIPT_NAME .. ".interface")
|
||||
or nmap.get_interface()
|
||||
@@ -92,6 +86,12 @@ local function single_interface_broadcast(if_nfo, results)
|
||||
local dnet = nmap.new_dnet()
|
||||
local pcap = nmap.new_socket()
|
||||
|
||||
local function catch ()
|
||||
dnet:ethernet_close()
|
||||
pcap:pcap_close()
|
||||
end
|
||||
local try = nmap.new_try(catch)
|
||||
|
||||
try(dnet:ethernet_open(if_nfo.device))
|
||||
pcap:pcap_open(if_nfo.device, 128, false, "icmp6 and ip6[6:1] = 58 and ip6[40:1] = 129")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user