summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-06-18 07:42:01 +0100
committerJeff Leung <jleung@v10networks.ca>2015-12-05 04:28:14 -0500
commit9254caf8bd4d8dfc0e76f1eb5958e6ebcdf1032d (patch)
tree3217d3cdf6fa3415ac9b91ee972cf01820cccdd1
parent013fd2ac5dc2cd426d85e850496bb826cb483109 (diff)
downloadvyatta-cfg-vpn-9254caf8bd4d8dfc0e76f1eb5958e6ebcdf1032d.tar.gz
vyatta-cfg-vpn-9254caf8bd4d8dfc0e76f1eb5958e6ebcdf1032d.zip
vyatta-cfg-vpn: vti interfaces remain link down after ipsec sa renewal
VTI interfaces can remain link down after IPSec SA expiry and renewal, leaving the actual IPSec tunnel up and active but the route relating to this VTI interface absent from the routing table; with the end result of no traffic passing through it without manual intervention. Earlier fixes for this issue in both bug #183 and bug #291 fixed one issue but introduced another, this commit fixes both scenarios. Bug #568 http://bugzilla.vyos.net/show_bug.cgi?id=568
-rwxr-xr-xscripts/vti-up-down2
-rwxr-xr-xscripts/vyatta-vti-config.pl7
2 files changed, 7 insertions, 2 deletions
diff --git a/scripts/vti-up-down b/scripts/vti-up-down
index 60fc191..378cb6e 100755
--- a/scripts/vti-up-down
+++ b/scripts/vti-up-down
@@ -5,7 +5,7 @@
source /etc/default/vyatta
source /etc/default/locale
case "$PLUTO_VERB" in
-route-client)
+route-client | up-client)
/opt/vyatta/sbin/vyatta-vti-config.pl --updown --intf=$1 --action=up
;;
down-client)
diff --git a/scripts/vyatta-vti-config.pl b/scripts/vyatta-vti-config.pl
index 980724c..23bead1 100755
--- a/scripts/vyatta-vti-config.pl
+++ b/scripts/vyatta-vti-config.pl
@@ -37,6 +37,7 @@ use lib "/opt/vyatta/share/perl5";
use Getopt::Long;
use Vyatta::VPN::vtiIntf;
use Vyatta::Config;
+use Vyatta::Misc;
my $vti_cfg_err = "VPN VTI configuration error:";
my $gencmds = "";
@@ -225,7 +226,11 @@ sub vti_handle_updown {
$vcIntf->setLevel('interfaces');
my $disabled = $vcIntf->existsOrig("vti $intfName disabled");
if (!defined($disabled) || !$disabled) {
- system("sudo /sbin/ip link set $intfName $action\n");
+ my $vtiInterface = new Vyatta::Interface($intfName);
+ my $state = $vtiInterface->up();
+ if (!($state && ($action eq "up"))) {
+ system("sudo /sbin/ip link set $intfName $action\n");
+ }
}
}