summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-09-18 15:57:52 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-09-18 15:57:52 -0300
commite5b3335ad921e072f20f052fd0e02a43aada700d (patch)
tree6f3fc37999c5d0a788c0ede94a6c81ec5b884472
parentcc265e2e59e0f2ce874d5446e1fa49cdaaae1cfb (diff)
downloadpfsense-e5b3335ad921e072f20f052fd0e02a43aada700d.zip
pfsense-e5b3335ad921e072f20f052fd0e02a43aada700d.tar.gz
Do not call write_config() when click on Apply Changes because it was already done and it causes dhcpd to restart one more time on secondary nodes. It fixes #3797
-rwxr-xr-xusr/local/www/services_dhcp.php54
1 files changed, 28 insertions, 26 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index a76c9c7..33dffba 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -211,7 +211,7 @@ function validate_partial_mac_list($maclist) {
return true;
}
-if ($_POST) {
+if (isset($_POST['submit'])) {
unset($input_errors);
@@ -503,33 +503,35 @@ if ($_POST) {
}
write_config();
+ }
+}
- $retval = 0;
- $retvaldhcp = 0;
- $retvaldns = 0;
- /* Stop DHCP so we can cleanup leases */
- killbyname("dhcpd");
- 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 {
- $retvaldhcp = services_dhcpd_configure();
- if ($retvaldhcp == 0)
- clear_subsystem_dirty('staticmaps');
+if (isset($_POST['submit']) || isset($_POST['apply'])) {
+ $retval = 0;
+ $retvaldhcp = 0;
+ $retvaldns = 0;
+ /* Stop DHCP so we can cleanup leases */
+ killbyname("dhcpd");
+ 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');
}
- if ($dhcpd_enable_changed)
- $retvalfc = filter_configure();
-
- if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1)
- $retval = 1;
- $savemsg = get_std_save_message($retval);
+ } else {
+ $retvaldhcp = services_dhcpd_configure();
+ if ($retvaldhcp == 0)
+ clear_subsystem_dirty('staticmaps');
}
+ if ($dhcpd_enable_changed)
+ $retvalfc = filter_configure();
+
+ if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1)
+ $retval = 1;
+ $savemsg = get_std_save_message($retval);
}
if ($act == "delpool") {
@@ -1159,7 +1161,7 @@ include("head.inc");
<input type="hidden" name="pool" value="<?php echo $pool; ?>"/>
<?php endif; ?>
<input name="if" type="hidden" value="<?=htmlspecialchars($if);?>"/>
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)"/>
+ <input name="submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)"/>
</td>
</tr>
<tr>
OpenPOWER on IntegriCloud