Bug #16979 ยป 16979.patch
| src/usr/local/pfSense/include/www/bandwidth_by_ip.inc | ||
|---|---|---|
|
// If hostname, description or FQDN is requested then load the locally-known IP address - host/description mappings into an array keyed by IP address.
|
||
|
if ($hostipformat != "") {
|
||
|
$domain = config_get_path('system/domain');
|
||
|
foreach (array_column(config_get_path('dhcpd', []), 'staticmap') as $hostent) {
|
||
|
if (($hostent['ipaddr'] != "") && ($hostent['hostname'] != "")) {
|
||
|
if ($hostipformat == "descr" && $hostent['descr'] != "") {
|
||
|
$iplookup[$hostent['ipaddr']] = $hostent['descr'];
|
||
|
} else {
|
||
|
$iplookup[$hostent['ipaddr']] = $hostent['hostname'];
|
||
|
if ($hostipformat == "fqdn") {
|
||
|
$iplookup[$hostent['ipaddr']] .= "." . $domain;
|
||
|
foreach (array_column(config_get_path('dhcpd', []), 'staticmap') as $ifsmaps) {
|
||
|
foreach ($ifsmaps as $hostent) {
|
||
|
if (($hostent['ipaddr'] != "") && ($hostent['hostname'] != "")) {
|
||
|
if ($hostipformat == "descr" && $hostent['descr'] != "") {
|
||
|
$iplookup[$hostent['ipaddr']] = $hostent['descr'];
|
||
|
} else {
|
||
|
$iplookup[$hostent['ipaddr']] = $hostent['hostname'];
|
||
|
if ($hostipformat == "fqdn") {
|
||
|
$iplookup[$hostent['ipaddr']] .= "." . $domain;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||