mirror of
https://github.com/nmap/nmap.git
synced 2026-11-28 10:30:14 +00:00
Merge 4c0daa191c into 4568fbc1b8
This commit is contained in:
commit
53834c4817
1 changed files with 21 additions and 1 deletions
|
|
@ -200,8 +200,28 @@ Comm = {
|
|||
output.location = location
|
||||
end
|
||||
|
||||
-- Ignore repeated SSDP responses without aborting discovery.
|
||||
-- Preserve distinct USNs reported by the same host.
|
||||
if key and results[key] then
|
||||
return false, "Already recorded a response for this host"
|
||||
local existing = results[key]
|
||||
|
||||
if usn and usn ~= existing.usn then
|
||||
local devices = existing.ssdp_devices or {}
|
||||
|
||||
for _, device in ipairs(devices) do
|
||||
if device.usn == usn then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
devices[#devices + 1] = {
|
||||
usn = usn,
|
||||
location = location
|
||||
}
|
||||
existing.ssdp_devices = devices
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
local server = string.match(response, "\n[Ss][Ee][Rr][Vv][Ee][Rr]:%s*(.-)\r?\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue