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
committerRenato Botelho <garga@FreeBSD.org>2015-04-27 09:13:48 -0300
commitcf3aff59edfa4b101d69ddd694a59fdc580d2299 (patch)
treebb134002258d5ca8ad107c04aed339ff08abf686 /usr/local/www/status_dhcp_leases.php
parentd7d6342c41361bfdb4b247e7b6f3730a4164e25f (diff)
downloadpfsense-cf3aff59edfa4b101d69ddd694a59fdc580d2299.zip
pfsense-cf3aff59edfa4b101d69ddd694a59fdc580d2299.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