mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
dhcp/leases, simplify interface lookup and make it more consistent. should fix https://github.com/opnsense/core/issues/3487
This commit is contained in:
parent
9b63e33621
commit
446caa9941
@ -401,32 +401,10 @@ legacy_html_escape_form_data($leases);
|
||||
}
|
||||
|
||||
$lip = ip2ulong($data['ip']);
|
||||
if ($data['act'] == "static") {
|
||||
foreach ($dhcpd as $dhcpif => $dhcpifconf) {
|
||||
if (isset($dhcpifconf['staticmap']) && is_array($dhcpifconf['staticmap'])) {
|
||||
foreach ($dhcpifconf['staticmap'] as $staticent) {
|
||||
if ($data['ip'] == $staticent['ipaddr']) {
|
||||
$data['int'] = htmlspecialchars($interfaces[$dhcpif]['descr']);
|
||||
$data['if'] = $dhcpif;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* exit as soon as we have an interface */
|
||||
if ($data['if'] != '') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($dhcpd as $dhcpif => $dhcpifconf) {
|
||||
if (empty($dhcpifconf['range'])) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($dhcpifconf["enable"]) && $lip >= ip2ulong($dhcpifconf['range']['from']) && $lip <= ip2ulong($dhcpifconf['range']['to'])) {
|
||||
$data['int'] = htmlspecialchars($interfaces[$dhcpif]['descr']);
|
||||
$data['if'] = $dhcpif;
|
||||
break;
|
||||
}
|
||||
foreach ($dhcpd as $dhcpif => $dhcpifconf) {
|
||||
if ($lip >= ip2ulong($dhcpifconf['range']['from']) && $lip <= ip2ulong($dhcpifconf['range']['to'])) {
|
||||
$data['int'] = htmlspecialchars($interfaces[$dhcpif]['descr']);
|
||||
$data['if'] = $dhcpif;
|
||||
}
|
||||
}
|
||||
$mac_hi = strtoupper($data['mac'][0] . $data['mac'][1] . $data['mac'][3] . $data['mac'][4] . $data['mac'][6] . $data['mac'][7]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user