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:
Miroslav Lichvar
2021-02-03 13:29:14 +01:00
parent f74eb67567
commit 1a8dcce84f
8 changed files with 17 additions and 23 deletions

View File

@@ -1678,7 +1678,6 @@ process_response(NCR_Instance inst, NTP_Local_Address *local_addr,
sample.root_delay = pkt_root_delay + sample.peer_delay;
sample.root_dispersion = pkt_root_dispersion + sample.peer_dispersion;
sample.stratum = MAX(message->stratum, inst->min_stratum);
/* Update the NTP timestamps. If it's a valid packet from a synchronised
source, the timestamps may be used later when processing a packet in the
@@ -1768,7 +1767,7 @@ process_response(NCR_Instance inst, NTP_Local_Address *local_addr,
inst->tx_count = 0;
SRC_UpdateReachability(inst->source, synced_packet);
SRC_SetLeapStatus(inst->source, pkt_leap);
SRC_UpdateStatus(inst->source, MAX(message->stratum, inst->min_stratum), pkt_leap);
if (good_packet) {
/* Adjust the polling interval, accumulate the sample, etc. */