Skip to content

Commit 496ca39

Browse files
fix: use new services_dhcpd_configure() function to apply DHCP Server changes
1 parent 2102e7c commit 496ca39

File tree

1 file changed

+1
-52
lines changed

1 file changed

+1
-52
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Dispatchers/DHCPServerApplyDispatcher.inc

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,6 @@ class DHCPServerApplyDispatcher extends Dispatcher {
1313
* Reloads the DHCP server and associated services.
1414
*/
1515
protected function _process(mixed ...$arguments): void {
16-
$retvaldhcp = 0;
17-
$retvaldns = 0;
18-
19-
if (Model::is_config_enabled('dnsmasq') && Model::is_config_enabled('dnsmasq', 'regdhcpstatic')) {
20-
$retvaldns |= services_dnsmasq_configure();
21-
if ($retvaldns == 0) {
22-
clear_subsystem_dirty('hosts');
23-
clear_subsystem_dirty('dhcpd');
24-
}
25-
if (Model::is_config_enabled('unbound') && Model::is_config_enabled('unbound', 'regdhcpstatic')) {
26-
$retvaldns |= services_unbound_configure();
27-
if ($retvaldns == 0) {
28-
clear_subsystem_dirty('unbound');
29-
clear_subsystem_dirty('hosts');
30-
clear_subsystem_dirty('dhcpd');
31-
}
32-
}
33-
} else {
34-
$retvaldhcp |= services_dhcpd_configure();
35-
if ($retvaldhcp == 0) {
36-
clear_subsystem_dirty('dhcpd');
37-
}
38-
}
39-
/* BIND package - Bug #3710 */
40-
if (!function_exists('is_package_installed')) {
41-
require_once 'pkg-utils.inc';
42-
}
43-
if (
44-
is_package_installed('pfSense-pkg-bind') &&
45-
Model::is_config_enabled('installedpackages/bind/config/0', 'enable_bind')
46-
) {
47-
$reloadbind = false;
48-
if (is_array(Model::get_config('installedpackages/bindzone'))) {
49-
$bindzone = Model::get_config('installedpackages/bindzone/config');
50-
} else {
51-
$bindzone = [];
52-
}
53-
for ($x = 0; $x < sizeof($bindzone); $x++) {
54-
$zone = $bindzone[$x];
55-
if ($zone['regdhcpstatic'] == 'on') {
56-
$reloadbind = true;
57-
break;
58-
}
59-
}
60-
if ($reloadbind === true) {
61-
if (file_exists('/usr/local/pkg/bind.inc')) {
62-
require_once '/usr/local/pkg/bind.inc';
63-
bind_sync();
64-
}
65-
}
66-
}
67-
filter_configure();
16+
services_dhcpd_configure();
6817
}
6918
}

0 commit comments

Comments
 (0)