mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Every ipOps function validates IP addresses, so no need to do it explicitly
This commit is contained in:
@@ -41,8 +41,7 @@ mld_query = function( if_nfo, arg_timeout )
|
|||||||
return nmap.registry[reg_entry]
|
return nmap.registry[reg_entry]
|
||||||
end
|
end
|
||||||
|
|
||||||
if ipOps.ip_to_str(if_nfo.address) == nil -- validate IP address
|
if not ipOps.ip_in_range(if_nfo.address, "fe80::/10") -- link local address
|
||||||
or not ipOps.ip_in_range(if_nfo.address, "fe80::/10") -- link local address
|
|
||||||
or if_nfo.link ~= "ethernet" then -- not the loopback interface
|
or if_nfo.link ~= "ethernet" then -- not the loopback interface
|
||||||
mutex('done')
|
mutex('done')
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ local function get_interfaces()
|
|||||||
local interfaces = {}
|
local interfaces = {}
|
||||||
for _, if_table in pairs(nmap.list_interfaces()) do
|
for _, if_table in pairs(nmap.list_interfaces()) do
|
||||||
if (interface_name == nil or if_table.device == interface_name) -- check for correct interface
|
if (interface_name == nil or if_table.device == interface_name) -- check for correct interface
|
||||||
and ipOps.ip_to_str(if_table.address) -- validate IP address
|
|
||||||
and ipOps.ip_in_range(if_table.address, "fe80::/10") -- link local address
|
and ipOps.ip_in_range(if_table.address, "fe80::/10") -- link local address
|
||||||
and if_table.link == "ethernet" then -- not the loopback interface
|
and if_table.link == "ethernet" then -- not the loopback interface
|
||||||
table.insert(interfaces, if_table)
|
table.insert(interfaces, if_table)
|
||||||
|
|||||||
Reference in New Issue
Block a user