summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-02-07 18:38:05 -0600
committerJohn Southworth <john.southworth@vyatta.com>2011-02-07 18:38:05 -0600
commit6f902e6b07b9a7df8f081d00fbb881e43e0c296b (patch)
treec8348312a32b78109d104d6e33ab7f0e2e827e9a /lib
parent64946eec7e9a27b5aa18ff8cfac493c5a0eea247 (diff)
downloadvyatta-op-vpn-6f902e6b07b9a7df8f081d00fbb881e43e0c296b.tar.gz
vyatta-op-vpn-6f902e6b07b9a7df8f081d00fbb881e43e0c296b.zip
Fix parsing when only the left subnet is configured
Diffstat (limited to 'lib')
-rw-r--r--lib/OPMode.pm17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm
index 64e7c85..6993843 100644
--- a/lib/OPMode.pm
+++ b/lib/OPMode.pm
@@ -175,6 +175,11 @@ sub get_tunnel_info {
my $lid = $2;
my $rip = $3;
my $rid = $4;
+ my $lsnet;
+ if ($lip =~ /(.*?)===(.*)/){
+ $lsnet = $1;
+ $lip = $2;
+ }
($lip, my $natt, my $natsrc, $rip, my $natdst) = nat_detect($lip, $rip);
$tunnel_hash{$connectid}->{_lid} = conv_id($lid);
$tunnel_hash{$connectid}->{_lip} = $lip;
@@ -183,20 +188,26 @@ sub get_tunnel_info {
$tunnel_hash{$connectid}->{_natt} = $natt;
$tunnel_hash{$connectid}->{_natsrc} = $natsrc;
$tunnel_hash{$connectid}->{_natdst} = $natdst;
- }
+ $tunnel_hash{$connectid}->{_lsnet} = $lsnet if (defined($lsnet));
+ }
elsif ($line =~ /: (.*?)\[(.*?)\]:(\d+)\/(\d+)...(.*?)\[(.*?)\]:(\d+)\/(\d+);/){
my $lip = $1;
+ my $lsnet;
my $lid = $2;
- my $lproto = $3;
- $lproto = conv_protocol($lproto);
+ my $lproto = conv_protocol($3);
my $lport = $4;
my $rip = $5;
my $rid = $6;
my $rproto = conv_protocol($7);
my $rport = $8;
+ if ($lip =~ /(.*?)===(.*)/){
+ $lsnet = $1;
+ $lip = $2;
+ }
($lip, my $natt, my $natsrc, $rip, my $natdst) = nat_detect($lip, $rip);
$tunnel_hash{$connectid}->{_lid} = conv_id($lid);
$tunnel_hash{$connectid}->{_lip} = $lip;
+ $tunnel_hash{$connectid}->{_lsnet} = $lsnet if (defined($lsnet));
$tunnel_hash{$connectid}->{_rid} = conv_id($rid);
$tunnel_hash{$connectid}->{_rip} = $rip;
$tunnel_hash{$connectid}->{_natt} = $natt;