diff options
author | Phil Davis <phil.davis@inf.org> | 2017-02-08 15:02:02 +0545 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-02-08 07:21:41 -0200 |
commit | 310f4f21ee1bef89988a1f41da778b88fc4d7215 (patch) | |
tree | 2d7f3d214430334bc1955d197e971bd0b7e7bd7f /src | |
parent | c940afeee675f0e4bdf31c7737e0c60f36674565 (diff) | |
download | pfsense-310f4f21ee1bef89988a1f41da778b88fc4d7215.zip pfsense-310f4f21ee1bef89988a1f41da778b88fc4d7215.tar.gz |
Part fix #7233 keep correct staticmap_array_index
The index needs to be incremented even for entries that were skipped for display because they (for whatever reason) have no MAC or CID set. So use the key directly from the array.
(cherry picked from commit 9aa3c5e84984958caa19ac76ecba849b94a8b360)
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/status_dhcp_leases.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/usr/local/www/status_dhcp_leases.php b/src/usr/local/www/status_dhcp_leases.php index 4f365de..6a4044a 100644 --- a/src/usr/local/www/status_dhcp_leases.php +++ b/src/usr/local/www/status_dhcp_leases.php @@ -312,8 +312,7 @@ $got_cid = false; foreach ($config['interfaces'] as $ifname => $ifarr) { if (is_array($config['dhcpd'][$ifname]) && is_array($config['dhcpd'][$ifname]['staticmap'])) { - $staticmap_array_index = 0; - foreach ($config['dhcpd'][$ifname]['staticmap'] as $static) { + foreach ($config['dhcpd'][$ifname]['staticmap'] as $idx => $static) { if (!empty($static['mac']) || !empty($static['cid'])) { $slease = array(); $slease['ip'] = $static['ipaddr']; @@ -330,9 +329,8 @@ foreach ($config['interfaces'] as $ifname => $ifarr) { $slease['descr'] = htmlentities($static['descr']); $slease['act'] = $static_string; $slease['online'] = in_array(strtolower($slease['mac']), $arpdata_mac) ? $online_string : $offline_string; - $slease['staticmap_array_index'] = $staticmap_array_index; + $slease['staticmap_array_index'] = $idx; $leases[] = $slease; - $staticmap_array_index++; } } } |