summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-09-18 14:08:22 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-09-18 14:08:22 -0300
commit565488c9cf34c60eccf0f364acc8a0372af31569 (patch)
tree63384ef52c7780add517f94fcc40d6a312b89756 /usr/local/www/services_dhcp.php
parent2439543813a64cae3d67c92c2530d6c73fc96d3f (diff)
downloadpfsense-565488c9cf34c60eccf0f364acc8a0372af31569.zip
pfsense-565488c9cf34c60eccf0f364acc8a0372af31569.tar.gz
Do now 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
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rw-r--r--usr/local/www/services_dhcp.php62
1 files changed, 32 insertions, 30 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index d8f0aa5..6de13c2 100644
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -216,7 +216,7 @@ function validate_partial_mac_list($maclist) {
return true;
}
-if ($_POST) {
+if (isset($_POST['submit'])) {
unset($input_errors);
@@ -518,37 +518,39 @@ 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 if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
- $retvaldns = services_unbound_configure();
- if ($retvaldns == 0)
- clear_subsystem_dirty('unbound');
- } 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 if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
+ $retvaldns = services_unbound_configure();
+ if ($retvaldns == 0)
+ clear_subsystem_dirty('unbound');
+ } 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") {
@@ -1195,7 +1197,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