mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31: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]
|
||||
end
|
||||
|
||||
if ipOps.ip_to_str(if_nfo.address) == nil -- validate IP address
|
||||
or not ipOps.ip_in_range(if_nfo.address, "fe80::/10") -- link local address
|
||||
if not ipOps.ip_in_range(if_nfo.address, "fe80::/10") -- link local address
|
||||
or if_nfo.link ~= "ethernet" then -- not the loopback interface
|
||||
mutex('done')
|
||||
return nil
|
||||
|
||||
@@ -71,7 +71,6 @@ local function get_interfaces()
|
||||
local interfaces = {}
|
||||
for _, if_table in pairs(nmap.list_interfaces()) do
|
||||
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 if_table.link == "ethernet" then -- not the loopback interface
|
||||
table.insert(interfaces, if_table)
|
||||
|
||||
Reference in New Issue
Block a user