mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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
This commit is contained in:
parent
a636c6ba3e
commit
a6bfa4ba23
@ -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") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user