sourcestats: don't load samples from future
When loading a dumped file, make sure there are no sample times in future relative to the current system time (e.g. after reboot with missing RTC).
This commit is contained in:
parent
9cc609c4b0
commit
02ccd3a3c7
1 changed files with 1 additions and 0 deletions
|
@ -931,6 +931,7 @@ SST_LoadFromFile(SST_Stats inst, FILE *in)
|
||||||
|
|
||||||
/* Make sure the samples are sane and they are in order */
|
/* Make sure the samples are sane and they are in order */
|
||||||
if (!UTI_IsTimeOffsetSane(&inst->sample_times[i], -inst->offsets[i]) ||
|
if (!UTI_IsTimeOffsetSane(&inst->sample_times[i], -inst->offsets[i]) ||
|
||||||
|
UTI_CompareTimespecs(&now, &inst->sample_times[i]) < 0 ||
|
||||||
!(fabs(inst->peer_delays[i]) < 1.0e6 && fabs(inst->peer_dispersions[i]) < 1.0e6 &&
|
!(fabs(inst->peer_delays[i]) < 1.0e6 && fabs(inst->peer_dispersions[i]) < 1.0e6 &&
|
||||||
fabs(inst->root_delays[i]) < 1.0e6 && fabs(inst->root_dispersions[i]) < 1.0e6) ||
|
fabs(inst->root_delays[i]) < 1.0e6 && fabs(inst->root_dispersions[i]) < 1.0e6) ||
|
||||||
(i > 0 && UTI_CompareTimespecs(&inst->sample_times[i],
|
(i > 0 && UTI_CompareTimespecs(&inst->sample_times[i],
|
||||||
|
|
Loading…
Reference in a new issue