From 988040972e8adf2fba35d3d85db45424f1613ff5 Mon Sep 17 00:00:00 2001 From: henning <> Date: Thu, 12 Oct 2006 10:40:45 +0000 Subject: [PATCH] internally, ntpd doesn't work with absolute offsets to system time, but takes the offset it adjtime() is already correcting for into account when taking the offset from a sensor, we need to correct it by the offset between system time and ntpd view. --- src/usr.sbin/ntpd/sensors.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/usr.sbin/ntpd/sensors.c b/src/usr.sbin/ntpd/sensors.c index ee8a0c31..4b635afa 100644 --- a/src/usr.sbin/ntpd/sensors.c +++ b/src/usr.sbin/ntpd/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.21 2006/08/19 16:56:54 henning Exp $ */ +/* $OpenBSD: sensors.c,v 1.22 2006/10/12 10:40:45 henning Exp $ */ /* * Copyright (c) 2006 Henning Brauer @@ -157,7 +157,8 @@ sensor_query(struct ntp_sensor *s) return; memcpy(&refid, "HARD", sizeof(refid)); - s->update.offset = 0 - (float)sensor.value / 1000000000.0; + s->update.offset = (0 - (float)sensor.value / 1000000000.0) - + getoffset(); s->update.rcvd = sensor.tv.tv_sec; s->update.good = 1;