From 8acdb5d1e208d2712daf01e512ad345d2ce5bd7e Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 25 Feb 2021 16:59:27 +0100 Subject: [PATCH] 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. --- refclock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/refclock.c b/refclock.c index 5cc2ca2..fcf7d59 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;