summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcpv6.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2016-02-24 16:47:50 -0500
committerjim-p <jimp@pfsense.org>2016-02-24 16:47:50 -0500
commit8f36f87aa5df4afc66de5bc1c78ae81e2404ef1c (patch)
treedb92d60f582afc6501b7963d95b3d2e169c425e5 /src/usr/local/www/services_dhcpv6.php
parent1c2b01a74ea2d87f2e2a5d1e056dac33c3a75cc5 (diff)
downloadpfsense-8f36f87aa5df4afc66de5bc1c78ae81e2404ef1c.zip
pfsense-8f36f87aa5df4afc66de5bc1c78ae81e2404ef1c.tar.gz
Move the DHCPv6 apply action into a function. Capture the apply and save actions separately and only perform the required task. Fixes #5910
Diffstat (limited to 'src/usr/local/www/services_dhcpv6.php')
-rw-r--r--src/usr/local/www/services_dhcpv6.php74
1 files changed, 40 insertions, 34 deletions
diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php
index 95958d5..4dfec4e 100644
--- a/src/usr/local/www/services_dhcpv6.php
+++ b/src/usr/local/www/services_dhcpv6.php
@@ -67,6 +67,42 @@
require("guiconfig.inc");
require_once("filter.inc");
+function dhcpv6_apply_changes($dhcpdv6_enable_changed) {
+ $retval = 0;
+ $retvaldhcp = 0;
+ $retvaldns = 0;
+ /* Stop DHCPv6 so we can cleanup leases */
+ killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
+ // dhcp_clean_leases();
+ /* dnsmasq_configure calls dhcpd_configure */
+ /* no need to restart dhcpd twice */
+ if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
+ $retvaldns = services_dnsmasq_configure();
+ if ($retvaldns == 0) {
+ clear_subsystem_dirty('hosts');
+ clear_subsystem_dirty('staticmaps');
+ }
+ } else if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
+ $retvaldns = services_unbound_configure();
+ if ($retvaldns == 0) {
+ clear_subsystem_dirty('unbound');
+ clear_subsystem_dirty('staticmaps');
+ }
+ } else {
+ $retvaldhcp = services_dhcpd_configure();
+ if ($retvaldhcp == 0) {
+ clear_subsystem_dirty('staticmaps');
+ }
+ }
+ if ($dhcpdv6_enable_changed) {
+ $retvalfc = filter_configure();
+ }
+ if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
+ $retval = 1;
+ }
+ return get_std_save_message($retval);
+}
+
if (!$g['services_dhcp_server_enable']) {
header("Location: /");
exit;
@@ -184,7 +220,9 @@ if (is_array($dhcrelaycfg) && isset($dhcrelaycfg['enable']) && isset($dhcrelaycf
}
}
-if ($_POST) {
+if ($_POST['apply'] == "Apply Changes") {
+ $savemsg = dhcpv6_apply_changes(false);
+} elseif ($_POST['Submit'] == "Save") {
unset($input_errors);
$old_dhcpdv6_enable = ($pconfig['enable'] == true);
@@ -445,39 +483,7 @@ if ($_POST) {
write_config();
- $retval = 0;
- $retvaldhcp = 0;
- $retvaldns = 0;
- /* Stop DHCPv6 so we can cleanup leases */
- killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
- // dhcp_clean_leases();
- /* dnsmasq_configure calls dhcpd_configure */
- /* no need to restart dhcpd twice */
- if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
- $retvaldns = services_dnsmasq_configure();
- if ($retvaldns == 0) {
- clear_subsystem_dirty('hosts');
- clear_subsystem_dirty('staticmaps');
- }
- } else if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
- $retvaldns = services_unbound_configure();
- if ($retvaldns == 0) {
- clear_subsystem_dirty('unbound');
- clear_subsystem_dirty('staticmaps');
- }
- } else {
- $retvaldhcp = services_dhcpd_configure();
- if ($retvaldhcp == 0) {
- clear_subsystem_dirty('staticmaps');
- }
- }
- if ($dhcpdv6_enable_changed) {
- $retvalfc = filter_configure();
- }
- if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
- $retval = 1;
- }
- $savemsg = get_std_save_message($retval);
+ $savemsg = dhcpv6_apply_changes($dhcpdv6_enable_changed);
}
}
OpenPOWER on IntegriCloud