summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-11-05 21:29:11 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-11-05 21:29:11 +0000
commita6bfa4ba238a7bd940dff8a46c95ad1e9db09dc8 (patch)
tree7da6e791abf37903b05882bdd204841ceb6a12b1 /usr
parenta636c6ba3e3d9f445deecce8d538f9de12f17057 (diff)
downloadpfsense-a6bfa4ba238a7bd940dff8a46c95ad1e9db09dc8.zip
pfsense-a6bfa4ba238a7bd940dff8a46c95ad1e9db09dc8.tar.gz
When displaying DHCP leases, call gethostbyaddr() to resolve the hostname if we do not have the record in the database
Also check to make sure gethostbyaddr() would return a real value Ticket 7390
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_dhcp_leases.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/local/www/diag_dhcp_leases.php b/usr/local/www/diag_dhcp_leases.php
index 2db2d75..474f453 100755
--- a/usr/local/www/diag_dhcp_leases.php
+++ b/usr/local/www/diag_dhcp_leases.php
@@ -115,8 +115,14 @@ while ($data = array_shift($return)) {
}
if ($data[0] == "client-hostname") {
$d = array_shift($return);
- $leases[$i]['hostname'] = $d[0];
- }
+ if($d[0] <> "") {
+ $leases[$i]['hostname'] = $d[0];
+ } else {
+ if(gethostbyaddr($leases[$i]['ip']) <> "") {
+ $leases[$i]['hostname'] = gethostbyaddr($leases[$i]['ip']);
+ }
+ }
+ }
if ($data[0] == "hardware") {
$d = array_shift($return);
if ($d[0] == "ethernet") {
OpenPOWER on IntegriCloud