mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Fix broadcast-dropbox-listener not giving output
The check for output using maxn was changed to use the # operator in r23147, but the table was not an "array"-style table. Changed it to test for next(ids) instead, which works.
This commit is contained in:
@@ -84,6 +84,10 @@ action = function()
|
|||||||
|
|
||||||
-- Check if we've already seen this ID.
|
-- Check if we've already seen this ID.
|
||||||
if ids[info.host_int] then
|
if ids[info.host_int] then
|
||||||
|
-- We can stop now, since we've seen the same ID twice
|
||||||
|
-- If ever a host sends a broadcast twice in a row, this will
|
||||||
|
-- artificially stop the listener. I can't think of a workaround
|
||||||
|
-- for now, so this will have to do.
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
ids[info.host_int] = true
|
ids[info.host_int] = true
|
||||||
@@ -118,7 +122,7 @@ action = function()
|
|||||||
sock:close()
|
sock:close()
|
||||||
|
|
||||||
-- If no broadcasts received, don't output anything.
|
-- If no broadcasts received, don't output anything.
|
||||||
if #ids == 0 then
|
if not next(ids) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user