ntp: don't update source status with unsynchronized data

Don't update the leap and stratum used in source selection if they
indicate an unsynchronized source.

Fixes: 2582be8754 ("sources: separate update of leap status")
This commit is contained in:
Miroslav Lichvar 2021-04-14 12:17:22 +02:00
parent aa22c515ce
commit 81f7f6ddf0

View file

@ -1766,7 +1766,8 @@ process_response(NCR_Instance inst, NTP_Local_Address *local_addr,
inst->tx_count = 0; inst->tx_count = 0;
SRC_UpdateReachability(inst->source, synced_packet); SRC_UpdateReachability(inst->source, synced_packet);
SRC_UpdateStatus(inst->source, MAX(message->stratum, inst->min_stratum), pkt_leap); if (synced_packet)
SRC_UpdateStatus(inst->source, MAX(message->stratum, inst->min_stratum), pkt_leap);
if (good_packet) { if (good_packet) {
/* Adjust the polling interval, accumulate the sample, etc. */ /* Adjust the polling interval, accumulate the sample, etc. */