mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:55:07 -05:00
sources: update stratum with leap status
Remove stratum from the NTP sample and update it together with the leap status. This enables a faster update when samples are dropped by the NTP filters.
This commit is contained in:
10
sources.c
10
sources.c
@@ -374,8 +374,10 @@ get_leap_status(void)
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
SRC_SetLeapStatus(SRC_Instance inst, NTP_Leap leap)
|
||||
SRC_UpdateStatus(SRC_Instance inst, int stratum, NTP_Leap leap)
|
||||
{
|
||||
inst->stratum = stratum;
|
||||
|
||||
if (REF_IsLeapSecondClose(NULL, 0.0))
|
||||
return;
|
||||
|
||||
@@ -401,17 +403,15 @@ SRC_AccumulateSample(SRC_Instance inst, NTP_Sample *sample)
|
||||
|
||||
assert(initialised);
|
||||
|
||||
DEBUG_LOG("src=%s ts=%s offset=%e delay=%e disp=%e stratum=%d",
|
||||
DEBUG_LOG("src=%s ts=%s offset=%e delay=%e disp=%e",
|
||||
source_to_string(inst), UTI_TimespecToString(&sample->time), -sample->offset,
|
||||
sample->root_delay, sample->root_dispersion, sample->stratum);
|
||||
sample->root_delay, sample->root_dispersion);
|
||||
|
||||
if (REF_IsLeapSecondClose(&sample->time, sample->offset)) {
|
||||
LOG(LOGS_INFO, "Dropping sample around leap second");
|
||||
return;
|
||||
}
|
||||
|
||||
inst->stratum = sample->stratum;
|
||||
|
||||
SST_AccumulateSample(inst->stats, sample);
|
||||
SST_DoNewRegression(inst->stats);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user