summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2008-06-05 09:29:40 +0000
committerSeth Mos <seth.mos@xs4all.nl>2008-06-05 09:29:40 +0000
commit2574c9221577110532c6544f2eec434a783baa70 (patch)
tree93247760430dc8fc007dc768082b60196f9ac98b
parent037b51b3839a8b904239fe06d8e604b70d7afd3d (diff)
downloadpfsense-2574c9221577110532c6544f2eec434a783baa70.zip
pfsense-2574c9221577110532c6544f2eec434a783baa70.tar.gz
If the Interface is not WAN remove static route on change
-rwxr-xr-xusr/local/www/vpn_ipsec_edit.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/local/www/vpn_ipsec_edit.php b/usr/local/www/vpn_ipsec_edit.php
index 8bd3295..0a338f4 100755
--- a/usr/local/www/vpn_ipsec_edit.php
+++ b/usr/local/www/vpn_ipsec_edit.php
@@ -239,6 +239,13 @@ if ($_POST) {
$ipsecent['interface'] = $pconfig['interface'];
pconfig_to_address($ipsecent['local-subnet'], $_POST['localnet'], $_POST['localnetmask']);
$ipsecent['remote-subnet'] = $_POST['remotenet'] . "/" . $_POST['remotebits'];
+ /* if the remote gateway changed and the interface is not WAN then remove route */
+ /* the vpn_ipsec_configure() handles adding the route */
+ if($_POST['interface'] <> "wan") {
+ if($ipsecent['remote-gateway'] <> $_POST['remotegw']) {
+ mwexec("/sbin/route delete -host {$ipsecent['remote-gateway']}");
+ }
+ }
$ipsecent['remote-gateway'] = $_POST['remotegw'];
$ipsecent['p1']['mode'] = $_POST['p1mode'];
@@ -658,4 +665,4 @@ function address_to_pconfig_vpn($adr, &$padr, &$pmask) {
}
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud