]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
refclock: warn if lock refid is invalid
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 25 Feb 2021 15:59:27 +0000 (16:59 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 25 Feb 2021 16:06:13 +0000 (17:06 +0100)
Log a warning message if the specified lock refid doesn't match any
existing refclock or it matches the refclock which has the lock option
itself.

refclock.c

index 5cc2ca26590420132713ffe941eb402f30bf47d2..fcf7d596976142385b4592eb02e8b2376aae3198 100644 (file)
@@ -296,6 +296,9 @@ RCL_StartRefclocks(void)
         lock_index = j;
         break;
       }
+
+      if (lock_index == -1 || lock_index == i)
+        LOG(LOGS_WARN, "Invalid lock refid %s", UTI_RefidToString(inst->lock_ref));
     }
 
     inst->lock_ref = lock_index;