]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: fix loading of refclock dump files
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 21 Apr 2021 10:52:17 +0000 (12:52 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 22 Apr 2021 08:20:31 +0000 (10:20 +0200)
Allow zero stratum in loaded dump files.

Fixes: f8610d69f08f ("sources: improve handling of dump files and their format")
sources.c

index 0d1bce5d5e690fb80af1fcbbc3dcbb37a669cd28..895172e7e64869e42a4f66acbd47548efe37f341 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -1428,7 +1428,7 @@ load_source(SRC_Instance inst)
         sscanf(words[0], "%d %o %d %d %d",
                &auth, &reach, &reach_size, &stratum, &leap) != 5 ||
         (!auth && inst->authenticated) ||
-        stratum < 1 || stratum >= NTP_MAX_STRATUM ||
+        stratum < 0 || stratum >= NTP_MAX_STRATUM ||
         leap < LEAP_Normal || leap >= LEAP_Unsynchronised ||
       !SST_LoadFromFile(inst->stats, f)) {
     LOG(LOGS_WARN, "Could not load dump file for %s", source_to_string(inst));