Services: DHCPv4 - when cleaning up static leases we probably shouldn't remove the ones where only a mac address is set (as placeholder for a description). could be https://github.com/opnsense/core/issues/6532

This commit is contained in:
Ad Schellevis 2023-04-29 09:51:51 +02:00
parent aefd3f0c2e
commit 2850c263c8

View File

@ -55,8 +55,8 @@ if (isset($opts['m'])) {
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
if (!empty($dhcpifconf['staticmap']) && !empty($dhcpifconf['enable'])) {
foreach ($dhcpifconf['staticmap'] as $static) {
if (!empty($static['mac'])) {
$addresses[$static['mac']] = !empty($static['ipaddr']) ? $static['ipaddr'] : "";
if (!empty($static['mac']) && !empty($static['ipaddr'])) {
$addresses[$static['mac']] = $static['ipaddr'];
}
}
}