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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user