summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Hendry <jhendry@mintel.com>2015-01-09 11:09:40 +0000
committerJason Hendry <jhendry@mintel.com>2015-01-20 09:00:37 +0000
commit8a0cd2190d23c89437df52786cdec5dc6a5f1e3d (patch)
tree353fb4af2143d9b4dd952e00edd5cfea798fae73
parent6111a883040ad8f4ccc770e34dc2dee8eed76ff2 (diff)
downloadvyatta-op-vpn-8a0cd2190d23c89437df52786cdec5dc6a5f1e3d.tar.gz
vyatta-op-vpn-8a0cd2190d23c89437df52786cdec5dc6a5f1e3d.zip
Removing ESP SA's in esp_hash which do not have a last_used key
-rw-r--r--lib/OPMode.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm
index 8af39d5..8faa4ae 100644
--- a/lib/OPMode.pm
+++ b/lib/OPMode.pm
@@ -620,6 +620,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}}) {