mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Added check for already discovered devices in order to avoid duplicates as
reported by David here: http://seclists.org/nmap-dev/2010/q4/257 [Patrik]
This commit is contained in:
parent
92b6fa9038
commit
5093705244
1 changed files with 13 additions and 6 deletions
|
|
@ -138,6 +138,7 @@ Comm = {
|
|||
receiveResponse = function( self )
|
||||
local status, response
|
||||
local result = {}
|
||||
local host_responses = {}
|
||||
|
||||
repeat
|
||||
status, response = self.socket:receive()
|
||||
|
|
@ -148,15 +149,21 @@ Comm = {
|
|||
end
|
||||
|
||||
local status, _, _, ip, _ = self.socket:get_info()
|
||||
if ( not(status) ) then
|
||||
return false, "Failed to retrieve socket information"
|
||||
end
|
||||
if target.ALLOW_NEW_TARGETS then target.add(ip) end
|
||||
|
||||
local status, output = self.decodeResponse( response )
|
||||
if ( not(status) ) then
|
||||
return false, "Failed to decode UPNP response"
|
||||
if ( not(host_responses[ip]) ) then
|
||||
local status, output = self.decodeResponse( response )
|
||||
if ( not(status) ) then
|
||||
return false, "Failed to decode UPNP response"
|
||||
end
|
||||
output = { output }
|
||||
output.name = ip
|
||||
table.insert( result, output )
|
||||
host_responses[ip] = true
|
||||
end
|
||||
output = { output }
|
||||
output.name = ip
|
||||
table.insert( result, output )
|
||||
until ( not( self.mcast ) )
|
||||
|
||||
if ( self.mcast ) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue