]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
refclock: set minimum maxlockage in local mode
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 11 May 2022 09:53:07 +0000 (11:53 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 11 May 2022 12:28:58 +0000 (14:28 +0200)
Use 3 as the minimum maxlockage in the local mode to avoid disruptions
due to losing the lock when a single sample is missed, e.g. when the PPS
driver polling interval is slightly longer than the pulse interval and a
pulse is skipped.

refclock.c

index b59acc3502abc24b8921d94c9a3721844013860e..e91828aa6c14b4151705511746b7b7d8c2e4185a 100644 (file)
@@ -237,6 +237,7 @@ RCL_AddRefclock(RefclockParameters *params)
     inst->pps_forced = 1;
     inst->lock_ref = inst->ref_id;
     inst->leap_status = LEAP_Unsynchronised;
+    inst->max_lock_age = MAX(inst->max_lock_age, 3);
   }
 
   if (inst->driver->poll) {