diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-02-04 13:23:38 -0600 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-02-04 13:23:38 -0600 |
commit | 79545a5450097781fffe6ab138e42d1a30760aa0 (patch) | |
tree | f61fc14b0b1c3cc5bb97475c2af784a32abe82cc /scripts | |
parent | af1c221bcc3b33a6d0d02fdb278500aa85c71a5e (diff) | |
download | vyatta-cfg-vpn-79545a5450097781fffe6ab138e42d1a30760aa0.tar.gz vyatta-cfg-vpn-79545a5450097781fffe6ab138e42d1a30760aa0.zip |
Move protocol out of local and remote nodes as it has to be the same
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vpn-config.pl | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl index 28c965b..e1a81fa 100755 --- a/scripts/vpn-config.pl +++ b/scripts/vpn-config.pl @@ -607,44 +607,42 @@ if ( $vcVPN->exists('ipsec') ) { # # Protocol/port # - my $lprotocol = $vcVPN->returnValue( - "ipsec site-to-site peer $peer tunnel $tunnel local protocol"); + my $protocol = $vcVPN->returnValue( + "ipsec site-to-site peer $peer tunnel $tunnel protocol"); my $lprotoport = ''; - if (defined($lprotocol)){ - $lprotoport .= $lprotocol; + if (defined($protocol)){ + $lprotoport .= $protocol; } my $lport = $vcVPN->returnValue( "ipsec site-to-site peer $peer tunnel $tunnel local port"); if (defined($lport)){ - if (!defined($lprotocol)){ + if (!defined($protocol)){ $lprotoport .= "0/$lport"; - } elsif (is_tcp_udp($lprotocol)){ + } elsif (is_tcp_udp($protocol)){ $lprotoport .= "/$lport"; } else { vpn_die(["vpn","ipsec","site-to-site","peer",$peer, "tunnel", $tunnel, "local", "port"], - "$vpn_cfg_err local port can only be defined when local protocol is tcp, udp, or undefined.\n"); + "$vpn_cfg_err local port can only be defined when protocol is tcp, udp, or undefined.\n"); } } if (not ($lprotoport eq '')){ $genout .= "\tleftprotoport=$lprotoport\n"; } - my $rprotocol = $vcVPN->returnValue( - "ipsec site-to-site peer $peer tunnel $tunnel remote protocol"); my $rprotoport = ''; - if (defined($rprotocol)){ - $rprotoport .= $rprotocol; + if (defined($protocol)){ + $rprotoport .= $protocol; } my $rport = $vcVPN->returnValue( "ipsec site-to-site peer $peer tunnel $tunnel remote port"); if (defined($rport)){ - if (!defined($rprotocol)){ + if (!defined($protocol)){ $rprotoport .= "0/$rport"; - } elsif (is_tcp_udp($rprotocol)){ + } elsif (is_tcp_udp($protocol)){ $rprotoport .= "/$rport"; } else { vpn_die(["vpn","ipsec","site-to-site","peer",$peer, "tunnel", $tunnel, "remote", "port"], - "$vpn_cfg_err remote port can only be defined when remote protocol is tcp, udp, or undefined.\n"); + "$vpn_cfg_err remote port can only be defined when protocol is tcp, udp, or undefined.\n"); } } if (not ($rprotoport eq '')){ |