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.
This commit is contained in:
Miroslav Lichvar 2021-02-25 16:59:27 +01:00
parent 62f2d5736d
commit 8acdb5d1e2

View file

@ -296,6 +296,9 @@ RCL_StartRefclocks(void)
lock_index = j; lock_index = j;
break; 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; inst->lock_ref = lock_index;