Skip to content

Commit

Permalink
Services: Kea DHCP [new]: Kea DHCPv4 - fix missing default domain in o…
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Apr 16, 2024
1 parent c4b64a4 commit e6c5771
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/opnsense/mvc/app/models/OPNsense/Kea/KeaDhcpv4.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,26 @@ private function getConfigSubnets()
'pools' => [],
'reservations' => []
];
/* standard option-data elements */
foreach ($subnet->option_data->iterateItems() as $key => $value) {
if (!empty((string)$value)) {
$target_fieldname = str_replace('_', '-', $key);
if ((string)$value != '') {
$record['option-data'][] = [
'name' => str_replace('_', '-', $key),
'name' => $target_fieldname,
'data' => (string)$value
];
} elseif ($key == 'domain_name') {
$record['option-data'][] = [
'name' => $target_fieldname,
'data' => (string)Config::getInstance()->object()->system->domain
];
}
}
/* add pools */
foreach (array_filter(explode("\n", $subnet->pools)) as $pool) {
$record['pools'][] = ['pool' => $pool];
}
/* static reservations */
foreach ($this->reservations->reservation->iterateItems() as $key => $reservation) {
if ($reservation->subnet != $subnet_uuid) {
continue;
Expand Down

0 comments on commit e6c5771

Please sign in to comment.