summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-01-25 18:05:51 -0600
committerJohn Southworth <john.southworth@vyatta.com>2011-01-25 18:05:51 -0600
commit4be28444bdc794a4d26517fb4dc06cdff72db219 (patch)
tree394668c3c40df0e56bc9831234ad20d575f03b11 /scripts
parent53f9b4f72acbae5b55873dcc9cf3647173ff32f5 (diff)
downloadvyatta-cfg-vpn-4be28444bdc794a4d26517fb4dc06cdff72db219.tar.gz
vyatta-cfg-vpn-4be28444bdc794a4d26517fb4dc06cdff72db219.zip
bugfix: 2506 added option to define initiatior or responder mode
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vpn-config.pl17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index 780b09b..30ff8ab 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -636,6 +636,7 @@ if ( $vcVPN->exists('ipsec') ) {
#
if (defined $leftsubnet && defined $rightsubnet) {
# validate that these values are ipv4net
+ ### ADD fix for 6229 here ###
my $valid_leftsubnet = 'false';
my $valid_rightsubnet = 'false';
@@ -646,7 +647,9 @@ if ( $vcVPN->exists('ipsec') ) {
my $localsubnet_object = new NetAddr::IP($leftsubnet);
my $remotesubnet_object = new NetAddr::IP($rightsubnet);
-
+ if ($remotesubnet_object == $localsubnet_object) {
+ Vyatta::Config::outputError(["vpn","ipsec","site-to-site","peer",$peer],"$vpn_cfg_err local-subnet and remote-subnet cannot be the same.\n");
+ }
if ($remotesubnet_object->contains($localsubnet_object)) {
$needs_passthrough = 'true';
}
@@ -970,7 +973,17 @@ if ( $vcVPN->exists('ipsec') ) {
if ($any_peer) {
$genout .= "\tauto=add\n";
} else {
- $genout .= "\tauto=start\n";
+ my $conntype = $vcVPN->returnValue("ipsec site-to-site peer $peer tunnel $tunnel connection-type");
+ if (defined ($conntype)){
+ if ($conntype eq "initiate"){
+ $genout .= "\tauto=start\n";
+ } elsif ($conntype eq "respond"){
+ $genout .= "\tauto=add\n";
+ }
+ }
+ else{
+ $genout .= "\tauto=start\n";
+ }
}
$conn_head =~ s/\n//;
$genout .= "#$conn_head"; # to identify end of connection definition