mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
determineScanGroupSize could cause a higher number of randomly generated hosts
to be scanned than was requested with -iR N (for 0 < N < 16) because it didn't account for max_ips_to_scan.
This commit is contained in:
parent
c47c0e2567
commit
d0a95fe03e
1 changed files with 4 additions and 0 deletions
|
|
@ -2038,6 +2038,10 @@ int determineScanGroupSize(int hosts_scanned_so_far,
|
|||
|
||||
groupsize = box(o.minHostGroupSz(), o.maxHostGroupSz(), groupsize);
|
||||
|
||||
if (o.max_ips_to_scan && (o.max_ips_to_scan - hosts_scanned_so_far) < groupsize)
|
||||
// don't scan more randomly generated hosts than was specified
|
||||
groupsize = o.max_ips_to_scan - hosts_scanned_so_far;
|
||||
|
||||
return groupsize;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue