diff options
author | gnhb <gnoahb@gmail.com> | 2010-10-02 12:27:16 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2010-10-02 12:27:16 +0700 |
commit | 318baca5f6658f52c0b895fdb8f42bc276e26a6d (patch) | |
tree | b4b3956473bb1ced0cb43df0c1d650ba8345ebce /usr | |
parent | 1bbd3d997f6146a3c52afb64d96fd0aadd25686c (diff) | |
download | pfsense-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')
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 11 |
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; |