summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/status_dhcp_leases.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-02-08 15:02:02 +0545
committerGitHub <noreply@github.com>2017-02-08 15:02:02 +0545
commit9aa3c5e84984958caa19ac76ecba849b94a8b360 (patch)
treeef3735685150b217c52685936d72902f6e20b31d /src/usr/local/www/status_dhcp_leases.php
parent7d7dd2ccfa262b1558e6ca2ea3f06e2faf7a404f (diff)
downloadpfsense-9aa3c5e84984958caa19ac76ecba849b94a8b360.zip
pfsense-9aa3c5e84984958caa19ac76ecba849b94a8b360.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.
Diffstat (limited to 'src/usr/local/www/status_dhcp_leases.php')
-rw-r--r--src/usr/local/www/status_dhcp_leases.php6
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 60748d4..bbc3b48 100644
--- a/src/usr/local/www/status_dhcp_leases.php
+++ b/src/usr/local/www/status_dhcp_leases.php
@@ -280,8 +280,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'];
@@ -298,9 +297,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++;
}
}
}
OpenPOWER on IntegriCloud