From: Miroslav Lichvar Date: Wed, 14 Apr 2021 10:17:22 +0000 (+0200) Subject: ntp: don't update source status with unsynchronized data X-Git-Tag: 4.1-pre1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81f7f6ddf08011d3b3f7bd02662e76dfa7855d78;p=thirdparty%2Fchrony.git 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: 2582be8754ab ("sources: separate update of leap status") --- diff --git a/ntp_core.c b/ntp_core.c index 68176ec0..37423329 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1766,7 +1766,8 @@ process_response(NCR_Instance inst, NTP_Local_Address *local_addr, inst->tx_count = 0; 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) { /* Adjust the polling interval, accumulate the sample, etc. */