You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function 'mysql_scan_discover_hosts_fping()' of class.phpipamAgent.php takes $subnet array as one of its arguments. Then it makes a loop with nested one while counters for both of them < sizeof($subnets).
But as $subnets array has gaps in its indexes (some of subnets were excluded from array in function 'mysql_fetch_subnets()' because of being masterSubnets) - total number of elements in array is less then maximum index value and theretofore addressing array elements by loop counter leads to skipping part of subnets from being scanned.
One of possible fixes - this one:
Change outer loop condintion from: for ($m=0; $m<=sizeof($subnets); $m += $this->config->threads)
to for ($m=0; $m<=max(array_keys($subnets)); $m += $this->config->threads)
And change inner loop condition from: for ($i = 0; $i < $this->config->threads && $zz <= sizeof($subnets); $i++)
to for ($i = 0; $i < $this->config->threads && $zz <= max(array_keys($subnets)); $i++)
The text was updated successfully, but these errors were encountered:
Function 'mysql_scan_discover_hosts_fping()' of class.phpipamAgent.php takes $subnet array as one of its arguments. Then it makes a loop with nested one while counters for both of them < sizeof($subnets).
But as $subnets array has gaps in its indexes (some of subnets were excluded from array in function 'mysql_fetch_subnets()' because of being masterSubnets) - total number of elements in array is less then maximum index value and theretofore addressing array elements by loop counter leads to skipping part of subnets from being scanned.
One of possible fixes - this one:
Change outer loop condintion from:
for ($m=0; $m<=sizeof($subnets); $m += $this->config->threads)
to
for ($m=0; $m<=max(array_keys($subnets)); $m += $this->config->threads)
And change inner loop condition from:
for ($i = 0; $i < $this->config->threads && $zz <= sizeof($subnets); $i++)
to
for ($i = 0; $i < $this->config->threads && $zz <= max(array_keys($subnets)); $i++)
The text was updated successfully, but these errors were encountered: