summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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);