summaryrefslogtreecommitdiff
path: root/scripts/vpn-config.pl
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-07-22 18:36:45 -0700
committerStig Thormodsrud <stig@vyatta.com>2008-07-22 18:36:45 -0700
commitbdef00e75a4474a136f3bb2432c98d5ac338fcaa (patch)
tree4f4be157296b38b5e453b9d71ac7fccf1b76a39b /scripts/vpn-config.pl
parent760876d8328880316720ebce2bdcc1b86372350c (diff)
downloadvyatta-cfg-vpn-bdef00e75a4474a136f3bb2432c98d5ac338fcaa.tar.gz
vyatta-cfg-vpn-bdef00e75a4474a136f3bb2432c98d5ac338fcaa.zip
Fix 3300: VPN over PPPOE completely fails on reboot
Diffstat (limited to 'scripts/vpn-config.pl')
-rwxr-xr-xscripts/vpn-config.pl20
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index 3a62a04..ad7cae1 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -221,6 +221,9 @@ if ($vcVPN->exists('ipsec')) {
$genout .= "\tinterfaces=\"";
my $counter = 0;
foreach my $interface (@interfaces) {
+ if (!(-d "/sys/class/net/$interface")) {
+ next;
+ }
if ($counter > 0) {
$genout .= ' ';
}
@@ -973,10 +976,21 @@ sub vpn_exec {
&& ($rval == 104 || $rval == 29)) {
print LOG "OK when bringing up VPN connection\n";
} else {
- $error = 1;
+ #
+ # We use to consider the commit failed if we got a error
+ # from the call to ipsec, but this causes the configuration
+ # to not get included in the running config. Now that
+ # we support dynamic interface/address (e.g. dhcp, pppoe)
+ # we want a valid config to get committed even if the
+ # interface doesn't exist yet. That way we can use
+ # "clear vpn ipsec-process" to bring up the tunnel once
+ # the interface is instantiated. For pppoe we will add
+ # a script to /etc/ppp/ip-up.d to bring up the vpn
+ # tunnel.
+ #
print LOG "VPN commit error. Unable to $desc, received error code $?\n";
- print STDERR "VPN commit error. Unable to $desc, received error code $?\n";
- print STDERR "$cmd_out\n";
+ print "Warning: unable to [$desc], received error code $?\n";
+ print "$cmd_out\n";
}
}
} else {