diff options
author | Jason Hendry <jhendry@mintel.com> | 2015-01-09 12:27:27 +0000 |
---|---|---|
committer | Jason Hendry <jhendry@mintel.com> | 2015-01-09 12:27:27 +0000 |
commit | 48821ce60a95f1a5a0d22656ecae0af9924b52c3 (patch) | |
tree | 713a28910e3d3168a946bfc84bf245ff64525383 | |
parent | 05ff24760a908158a2deb1f545cb75590136044a (diff) | |
download | vyatta-op-vpn-48821ce60a95f1a5a0d22656ecae0af9924b52c3.tar.gz vyatta-op-vpn-48821ce60a95f1a5a0d22656ecae0af9924b52c3.zip |
Improving detection of dead tunnels for IKEv2
-rw-r--r-- | lib/OPMode.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm index d9f7526..87ce910 100644 --- a/lib/OPMode.pm +++ b/lib/OPMode.pm @@ -642,7 +642,8 @@ sub process_tunnels{ foreach my $data (keys %{$esp_hash{$connectid}{$esp_sa}}) { $tunnel_hash{$connectid}->{$data} = $esp_hash{$connectid}{$esp_sa}{$data} if ($data =~ /^_/); } - my $atime = $tunnel_hash{$connectid}->{_lifetime} - $tunnel_hash{$connectid}->{_expire}; + my ($atime, $esp_lifetime, $esp_expire) = (-1, $tunnel_hash{$connectid}->{_lifetime}, $tunnel_hash{$connectid}->{_expire}); + $atime = $esp_lifetime - $esp_expire if (($esp_lifetime ne 'n/a') && ($esp_expire ne 'n/a')); $tunnel_hash{$connectid}->{_state} = "up" if ($atime >= 0); last; } |