From 38590801e06fffc3b231af0c6ef231853d7519fb Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Sun, 25 Oct 2009 15:48:02 +0000 Subject: [PATCH] Added better --debug output for time differences on incoming SPA packets. This makes it easier to tell when there are problems with time synchronization between the fwknop client and fwknopd server systems. git-svn-id: file:///home/mbr/svn/fwknop/trunk@159 510a4753-2344-4c79-9c09-4d669213fbeb --- perl/legacy/fwknop/fwknopd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/perl/legacy/fwknop/fwknopd b/perl/legacy/fwknop/fwknopd index d2bc6904..0ed55653 100755 --- a/perl/legacy/fwknop/fwknopd +++ b/perl/legacy/fwknop/fwknopd @@ -979,10 +979,12 @@ sub SPA_check_packet_age() { my $remote_time = shift; if ($config{'ENABLE_SPA_PACKET_AGING'} eq 'Y') { - if (abs((time() - $remote_time)) - > $config{'MAX_SPA_PACKET_AGE'}) { + my $time_diff = time() - $remote_time; + if (abs($time_diff) > $config{'MAX_SPA_PACKET_AGE'}) { &logr('[-]', "remote time stamp age difference is larger than " . "$config{'MAX_SPA_PACKET_AGE'} second max.", $SEND_MAIL); + print STDERR localtime() . " [-] Time difference: $time_diff " . + "(seconds), " . ($time_diff / 3600) . " (hours)\n"; return 0; } }