]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: don't update source status with unsynchronized data
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 14 Apr 2021 10:17:22 +0000 (12:17 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 15 Apr 2021 13:16:39 +0000 (15:16 +0200)
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")
ntp_core.c

index 68176ec0a9e30b7c9357f2bd89e4de9856c6097b..374233296b8261e4d8c24186a2398d215c48567e 100644 (file)
@@ -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. */