mirror of
https://gitlab.com/chrony/chrony.git
synced 2026-01-21 13:20:20 -05:00
sources: separate update of leap status
Remove leap status from the NTP sample and set it independently from the sample accumulation in order to accept a leap second sooner when samples are filtered.
This commit is contained in:
12
sources.c
12
sources.c
@@ -326,6 +326,17 @@ SRC_GetSourcestats(SRC_Instance instance)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
SRC_SetLeapStatus(SRC_Instance inst, NTP_Leap leap)
|
||||
{
|
||||
if (REF_IsLeapSecondClose())
|
||||
return;
|
||||
|
||||
inst->leap = leap;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
/* This function is called by one of the source drivers when it has
|
||||
a new sample that is to be accumulated.
|
||||
|
||||
@@ -351,7 +362,6 @@ SRC_AccumulateSample(SRC_Instance inst, NTP_Sample *sample)
|
||||
|
||||
SST_AccumulateSample(inst->stats, sample);
|
||||
SST_DoNewRegression(inst->stats);
|
||||
inst->leap = sample->leap;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user