Skip to content

Commit

Permalink
Update modules/auxiliary/scanner/discovery/ipv6_neighbor.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Spencer McIntyre <58950994+smcintyre-r7@users.noreply.github.com>
  • Loading branch information
NikitaKovaljov and smcintyre-r7 authored May 25, 2022
1 parent 71acc02 commit b66fb88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/auxiliary/scanner/discovery/ipv6_neighbor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def run_batch(hosts)
end
end

etime = ::Time.now.to_f + 1
etime = ::Time.now.to_f + [1, hosts.length * 0.05].max

while (::Time.now.to_f < etime)
while(reply = getreply())
Expand Down

1 comment on commit b66fb88

@abbbe
Copy link
Contributor

@abbbe abbbe commented on b66fb88 May 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smcintyre-r7, Please note getreply() already includes 0.1s sleep. So it appears the job of the code below line 77 is to handle responses to the most recent probes. In the worst case scenario the responses will get buffered in pcap socket buffer (up to 2MB by default in Linux I think) and that buffer will be processed by the loop starting at line 80. Unless I miss something, there is absolutely no reason to make etime dependent on number of host. But there is a disadvantage - in case of 1000 hosts this will result in completely pointless and arbitrary 50s delay.

I have just noticed this implementation line, maybe we should do the same (fixed configurable timeout) in ipv6 module?

Please sign in to comment.