X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProtHandle.pm;h=a42ba33e871de8496d1f138414140ca37470d479;hb=ca3a14c5a22a621e9b69ecf0acc2a5da08c5ab91;hp=7d2968cedb626ccdc85be4a3e656eacdade0da57;hpb=40178a4be6f9dc1e1a409b96fc087cf971886fd0;p=spider.git diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 7d2968ce..a42ba33e 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -46,7 +46,8 @@ use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restim $eph_pc15_restime $pc9x_past_age $pc9x_future_age ); -$pc9x_past_age = 15*60; # maximum age in the past of a px9x +$pc9x_past_age = 62*60; # maximum age in the past of a px9x (a config record might be the only + # thing a node might send - once an hour) $pc9x_future_age = 5*60; # maximum age in the future ditto # incoming talk commands @@ -1422,14 +1423,19 @@ sub check_pc9x_t if ($parent->call ne $main::mycall) { my $lastid = $parent->lastid->{$pc} || 0; if ($t < $lastid) { - if ($lastid-86400+$t > $pc9x_past_age) { - dbg("PCPROT: dup id on $t <= $lastid (midnight rollover), ignored") if isdbg('chanerr'); + if ($t+86400-$lastid > $pc9x_past_age) { + dbg("PCPROT: dup id on $t <= $lastid, ignored") if isdbg('chanerr'); return; } - } - if ($lastid >= $t) { - dbg("PCPROT: dup id on $call $lastid >= $t, ignored") if isdbg('chanerr'); + } elsif ($t == $lastid) { + dbg("PCPROT: dup id on $t == $lastid, ignored") if isdbg('chanerr'); return; + } else { + # $t > $lastid, check that the timestamp offered isn't too far away from 'now' + if ($t+$main::systime_daystart-$main::systime > $pc9x_future_age ) { + dbg("PCPROT: id $t too far in the future, ignored") if isdbg('chanerr'); + return; + } } } } elsif ($create) {