1
0
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:
dmiller
2015-12-19 15:25:43 +00:00
parent 566120ca58
commit a11db08325
2 changed files with 1 additions and 3 deletions

View File

@@ -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

View File

@@ -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)