]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
refclock: fix invalid warning in local mode
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 9 May 2022 14:41:27 +0000 (16:41 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 11 May 2022 12:22:41 +0000 (14:22 +0200)
A refclock in the local mode is locked to itself by design.

Reported-by: Dan Drown <dan-ntp@drown.org>
refclock.c

index 42acd53caf1a82edded1dbff5e5c47354d8f1d16..272777ab7c95a26055e42a33b01c179de0e7e0ce 100644 (file)
@@ -308,7 +308,7 @@ RCL_StartRefclocks(void)
         break;
       }
 
-      if (lock_index == -1 || lock_index == i)
+      if (lock_index == -1 || (lock_index == i && !inst->local))
         LOG(LOGS_WARN, "Invalid lock refid %s", UTI_RefidToString(inst->lock_ref));
     }