diff options
author | Ermal <eri@pfsense.org> | 2013-09-03 16:52:07 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-09-03 16:52:43 +0000 |
commit | 32a9eb1873d67ae581ba084ee9fcbf079215ecce (patch) | |
tree | 75ee87c37f2863a8b02879da829f0d8d5b48fe39 /usr/local/www/system_gateways_edit.php | |
parent | 243680e54daea3fa26134450f5be8277e25e091a (diff) | |
download | pfsense-32a9eb1873d67ae581ba084ee9fcbf079215ecce.zip pfsense-32a9eb1873d67ae581ba084ee9fcbf079215ecce.tar.gz |
Bring back static routes to fix issues reported on Ticext #3179
Diffstat (limited to 'usr/local/www/system_gateways_edit.php')
-rwxr-xr-x | usr/local/www/system_gateways_edit.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 417184c..7abd1f4 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -384,8 +384,17 @@ if ($_POST) { $gateway['descr'] = $_POST['descr']; if ($_POST['monitor_disable'] == "yes") $gateway['monitor_disable'] = true; - else if (is_ipaddr($_POST['monitor'])) + 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[$id]) && is_ipaddr($a_gateway_item[$id]['monitor']) && + $_POST['monitor'] != $a_gateway_item[$id]['monitor'] && $gateway['gateway'] != $a_gateway_item[$id]['monitor']) { + if (is_ipaddrv4($a_gateway_item[$id]['monitor'])) + mwexec("/sbin/route delete " . escapeshellarg($a_gateway_item[$id]['monitor'])); + else + mwexec("/sbin/route delete -inet6 " . escapeshellarg($a_gateway_item[$id]['monitor'])); + } $gateway['monitor'] = $_POST['monitor']; + } if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") { $i = 0; |