diff options
-rwxr-xr-x | usr/local/www/diag_dhcp_leases.php | 10 |
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") { |