summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-12-27 12:12:31 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-12-27 12:12:44 -0200
commitfcd01c8a29221afddca5e43a0422feccf132c3b5 (patch)
tree2ab2138912db7aafde354dd43b9e76478161bf68 /usr/local/www
parentee574a9e332bb0468865cfd4d2cf202fb4c4bc3e (diff)
downloadpfsense-fcd01c8a29221afddca5e43a0422feccf132c3b5.zip
pfsense-fcd01c8a29221afddca5e43a0422feccf132c3b5.tar.gz
Delete static route when monitor IP is removed, also save monitor IP even when it's disabled
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/system_gateways_edit.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 2413b53..1911921 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -388,16 +388,16 @@ if ($_POST) {
$gateway['descr'] = $_POST['descr'];
if ($_POST['monitor_disable'] == "yes")
$gateway['monitor_disable'] = true;
- else if (is_ipaddr($_POST['monitor'])) {
- /* NOTE: If monitor ip is changed need to cleanup the old static route */
- if ($_POST['monitor'] != "dynamic" && !empty($a_gateway_item[$realid]) && is_ipaddr($a_gateway_item[$realid]['monitor']) &&
- $_POST['monitor'] != $a_gateway_item[$realid]['monitor'] && $gateway['gateway'] != $a_gateway_item[$realid]['monitor']) {
- if (is_ipaddrv4($a_gateway_item[$realid]['monitor']))
- mwexec("/sbin/route delete " . escapeshellarg($a_gateway_item[$realid]['monitor']));
- else
- mwexec("/sbin/route delete -inet6 " . escapeshellarg($a_gateway_item[$realid]['monitor']));
- }
+ if (is_ipaddr($_POST['monitor']))
$gateway['monitor'] = $_POST['monitor'];
+
+ /* NOTE: If monitor ip is changed need to cleanup the old static route */
+ if ($_POST['monitor'] != "dynamic" && !empty($a_gateway_item[$realid]) && is_ipaddr($a_gateway_item[$realid]['monitor']) &&
+ $_POST['monitor'] != $a_gateway_item[$realid]['monitor'] && $gateway['gateway'] != $a_gateway_item[$realid]['monitor']) {
+ if (is_ipaddrv4($a_gateway_item[$realid]['monitor']))
+ mwexec("/sbin/route delete " . escapeshellarg($a_gateway_item[$realid]['monitor']));
+ else
+ mwexec("/sbin/route delete -inet6 " . escapeshellarg($a_gateway_item[$realid]['monitor']));
}
if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") {
OpenPOWER on IntegriCloud