]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
reference: don't report zero stratum when synchronised
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Jul 2017 09:27:24 +0000 (11:27 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Jul 2017 15:40:35 +0000 (17:40 +0200)
If synchronised to a stratum 15 source, return stratum of 16 instead of
0 in the tracking report. It will not match the value in server mode
packets, but it should be less confusing.

reference.c

index 488e58c7f3878732ad86a1316bc2a7aeb67f8a54..6b9ccc169c113360e3b016a074de24c54e09da19 100644 (file)
@@ -1366,7 +1366,7 @@ REF_GetTrackingReport(RPT_TrackingReport *rep)
                          &rep->ref_id, &rep->ref_time,
                          &rep->root_delay, &rep->root_dispersion);
 
-  if (rep->stratum == NTP_MAX_STRATUM)
+  if (rep->stratum == NTP_MAX_STRATUM && !synchronised)
     rep->stratum = 0;
 
   rep->ip_addr.family = IPADDR_UNSPEC;