diff options
author | Jason Hendry <jhendry@mintel.com> | 2015-01-09 11:09:40 +0000 |
---|---|---|
committer | Jason Hendry <jhendry@mintel.com> | 2015-01-09 11:09:40 +0000 |
commit | 08b121778a138580b9f6a5b6b81180cb824968c9 (patch) | |
tree | 97df0c65a9bd721c94aaebfb57b30207d8d2f596 /lib | |
parent | 05ff24760a908158a2deb1f545cb75590136044a (diff) | |
download | vyatta-op-vpn-08b121778a138580b9f6a5b6b81180cb824968c9.tar.gz vyatta-op-vpn-08b121778a138580b9f6a5b6b81180cb824968c9.zip |
Removing ESP SA's in esp_hash which do not have a last_used key
Diffstat (limited to 'lib')
-rw-r--r-- | lib/OPMode.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm index d9f7526..8440b0c 100644 --- a/lib/OPMode.pm +++ b/lib/OPMode.pm @@ -636,6 +636,13 @@ sub process_tunnels{ } } + # Cleanse esp_hash + foreach my $connectid (keys %esp_hash) { + foreach my $esp_sa (keys %{$esp_hash{$connectid}}) { + delete $esp_hash{$connectid}{$esp_sa} if (not defined($esp_hash{$connectid}{$esp_sa}{last_used})); + } + } + # For each tunnel, loop through all ESP SA's and extract data from one most recently used foreach my $connectid (keys %esp_hash) { foreach my $esp_sa (reverse sort {$esp_hash{$a}{last_used} <=> $esp_hash{$b}{last_used}} keys %{$esp_hash{$connectid}}) { |