From: Miroslav Lichvar Date: Thu, 25 Feb 2021 15:59:27 +0000 (+0100) Subject: refclock: warn if lock refid is invalid X-Git-Tag: 4.1-pre1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8acdb5d1e208d2712daf01e512ad345d2ce5bd7e;p=thirdparty%2Fchrony.git refclock: warn if lock refid is invalid 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. --- diff --git a/refclock.c b/refclock.c index 5cc2ca26..fcf7d596 100644 --- a/refclock.c +++ b/refclock.c @@ -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;