summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_gateways_edit.php
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-10-02 12:27:16 +0700
committergnhb <gnoahb@gmail.com>2010-10-02 12:27:16 +0700
commit318baca5f6658f52c0b895fdb8f42bc276e26a6d (patch)
treeb4b3956473bb1ced0cb43df0c1d650ba8345ebce /usr/local/www/system_gateways_edit.php
parent1bbd3d997f6146a3c52afb64d96fd0aadd25686c (diff)
downloadpfsense-318baca5f6658f52c0b895fdb8f42bc276e26a6d.zip
pfsense-318baca5f6658f52c0b895fdb8f42bc276e26a6d.tar.gz
Update code to actually accomplish the intended behavior of NOT reloading the interface
if not necessary when a GW record is saved.
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-xusr/local/www/system_gateways_edit.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index d1fcd30..a790db9 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -197,7 +197,6 @@ if ($_POST) {
if (!$input_errors) {
if (!(($_POST['weight'] && $_POST['weight'] > 1) || $_POST['latencylow'] || $_POST['latencyhigh'] ||
$_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] ||
- ($_POST['defaultgw'] && !$pconfig['defaultgw']) || (!$_POST['defaultgw'] && $pconfig['defaultgw']) ||
(empty($_POST['monitor']) || (!empty($_POST['gateway']) && $_POST['gateway'] != "dynamic")) ||
(empty($_POST['monitor']) || (!empty($_POST['monitor']) && $_POST['monitor'] != "dynamic")))) {
if (isset($id) && $a_gateway_item[$id])
@@ -226,11 +225,15 @@ if ($_POST) {
$gateway['monitor'] = $_POST['monitor'];
if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") {
+ $reloadif = true;
$i = 0;
- foreach($a_gateway_item as $gw) {
+ foreach($a_gateway_item as $gw_item_id => $gw) {
unset($config['gateways']['gateway_item'][$i]['defaultgw']);
- if ($gw['interface'] != $_POST['interface'])
- $reloadif = true;
+ /* if true $gw is the *saved* gateway config data and
+ * we don't need to reload if this GW interface didn't change AND this GW was already default */
+ if (isset($id) && $gw_item_id == $id)
+ if ($gw['interface'] == $_POST['interface'] && isset($gw['defaultgw']) )
+ $reloadif = false;
$i++;
}
$gateway['defaultgw'] = true;
OpenPOWER on IntegriCloud