summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_dhcp_leases.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-04-23 20:41:19 +0545
committerPhil Davis <phil.davis@inf.org>2015-04-23 20:41:19 +0545
commit49878b9e9d49205d69c6ec4354f4ca18cb277b36 (patch)
tree22dc0a13b701af51e00cda8ab5a76ed77eaca140 /usr/local/www/status_dhcp_leases.php
parentd6f74188816a6a3e1cb25527ecefad4a751e1237 (diff)
downloadpfsense-49878b9e9d49205d69c6ec4354f4ca18cb277b36.zip
pfsense-49878b9e9d49205d69c6ec4354f4ca18cb277b36.tar.gz
Add static mapping interface not set when IP in a pool
If the DHCP IP address is in a pool (not in the main DHCP range for the interface) then the interface that corresponds to the IP address is not found. This results in the link to "add static mapping for this MAC address" not having any value for "if=" and thus clicking on the "+" button does not work. Reported in bug 4649 Process any pools when checking for which interface contains the IP address.
Diffstat (limited to 'usr/local/www/status_dhcp_leases.php')
-rw-r--r--usr/local/www/status_dhcp_leases.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php
index 24c41b8..158a733 100644
--- a/usr/local/www/status_dhcp_leases.php
+++ b/usr/local/www/status_dhcp_leases.php
@@ -371,6 +371,17 @@ foreach ($leases as $data) {
$data['if'] = $dhcpif;
break;
}
+ // Check if the IP is in the range of any DHCP pools
+ if (is_array($dhcpifconf['pool'])) {
+ foreach ($dhcpifconf['pool'] as $dhcppool) {
+ if (is_array($dhcppool['range'])) {
+ if (($lip >= ip2ulong($dhcppool['range']['from'])) && ($lip <= ip2ulong($dhcppool['range']['to']))) {
+ $data['if'] = $dhcpif;
+ break 2;
+ }
+ }
+ }
+ }
}
}
echo "<tr>\n";
OpenPOWER on IntegriCloud