summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/ntp.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-01-14 19:20:10 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-01-14 19:20:10 +0000
commit093ee6585c7f2465e20fdb894ef3c2f7152f5a29 (patch)
tree4c3dbc2188b85f6c6bd9c26ba50c0766f23c86e0 /usr.sbin/ntpd/ntp.c
parent1379c813c6ce049790e8af02e9034a95cc815ac9 (diff)
Esape from the Mouth of Madness by adjusting stored sensor offsets
when we adjust time. This prevents ntpd from going wild when using sensor time sources; ok henning@ (on an earlier version) and a LOT of testing by naddy@
Diffstat (limited to 'usr.sbin/ntpd/ntp.c')
-rw-r--r--usr.sbin/ntpd/ntp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 62baf61b68c..316f35af230 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.96 2006/12/20 16:50:13 henning Exp $ */
+/* $OpenBSD: ntp.c,v 1.97 2007/01/14 19:20:09 otto Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -564,6 +564,11 @@ priv_adjtime(void)
p->reply[i].offset -= offset_median;
p->update.good = 0;
}
+ TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
+ for (i = 0; i < SENSOR_OFFSETS; i++)
+ s->offsets[i].offset -= offset_median;
+ s->update.offset -= offset_median;
+ }
return (0);
}