summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJason Hendry <jhendry@mintel.com>2015-01-09 12:56:54 +0000
committerJason Hendry <jhendry@mintel.com>2015-01-09 12:56:54 +0000
commit022775f1548ccfc83af53198a9b4b09fb9010f0a (patch)
tree3a0528c12e31c023ed3e3f1153bc8567bdf918d2 /lib
parent48821ce60a95f1a5a0d22656ecae0af9924b52c3 (diff)
downloadvyatta-op-vpn-022775f1548ccfc83af53198a9b4b09fb9010f0a.tar.gz
vyatta-op-vpn-022775f1548ccfc83af53198a9b4b09fb9010f0a.zip
Improving dead IKE detection for IKEv2
Diffstat (limited to 'lib')
-rw-r--r--lib/OPMode.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm
index 87ce910..8493806 100644
--- a/lib/OPMode.pm
+++ b/lib/OPMode.pm
@@ -586,7 +586,9 @@ sub process_tunnels{
} elsif ($line =~ /\]:\s+IKE SPIs: .* (reauthentication|rekeying) in (.*)/) {
$tunnel_hash{$connectid}->{_ikeexpire} = conv_time($2);
- my $atime = $tunnel_hash{$connectid}->{_ikelife} - $tunnel_hash{$connectid}->{_ikeexpire};
+
+ my ($atime, $ike_lifetime, $ike_expire) = (-1, $tunnel_hash{$connectid}->{_ikelife}, $tunnel_hash{$connectid}->{_ikeexpire});
+ $atime = $ike_lifetime - $ike_expire if (($ike_lifetime ne 'n/a') && ($ike_expire ne 'n/a'));
$tunnel_hash{$connectid}->{_ikestate} = "up" if ($atime >= 0);