summaryrefslogtreecommitdiffstats
path: root/refclock.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 05:01:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 05:01:23 +0000
commitad8b7d9e228c894c12cc061770b1a39d037e90ab (patch)
treed5bee8d23cb0a8de0d2fcab6b74d5becc8598296 /refclock.c
parentAdding upstream version 4.5. (diff)
downloadchrony-ad8b7d9e228c894c12cc061770b1a39d037e90ab.tar.xz
chrony-ad8b7d9e228c894c12cc061770b1a39d037e90ab.zip
Adding upstream version 4.6.upstream/4.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'refclock.c')
-rw-r--r--refclock.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/refclock.c b/refclock.c
index 84f7439..22d775a 100644
--- a/refclock.c
+++ b/refclock.c
@@ -166,8 +166,8 @@ RCL_AddRefclock(RefclockParameters *params)
if (!inst->driver->init && !inst->driver->poll)
LOG_FATAL("refclock driver %s is not compiled in", params->driver_name);
- if (params->tai && !CNF_GetLeapSecTimezone())
- LOG_FATAL("refclock tai option requires leapsectz");
+ if (params->tai && !CNF_GetLeapSecList() && !CNF_GetLeapSecTimezone())
+ LOG_FATAL("refclock tai option requires leapseclist or leapsectz");
inst->data = NULL;
inst->driver_parameter = Strdup(params->driver_parameter);
@@ -321,6 +321,22 @@ RCL_ReportSource(RPT_SourceReport *report, struct timespec *now)
}
}
+int
+RCL_ModifyOffset(uint32_t ref_id, double offset)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARR_GetSize(refclocks); i++) {
+ RCL_Instance inst = get_refclock(i);
+ if (inst->ref_id == ref_id) {
+ inst->offset = offset;
+ LOG(LOGS_INFO, "Source %s new offset %f", UTI_RefidToString(ref_id), offset);
+ return 1;
+ }
+ }
+ return 0;
+}
+
void
RCL_SetDriverData(RCL_Instance instance, void *data)
{