summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/ntp.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-06-07 06:29:04 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-06-07 06:29:04 +0000
commitb3297db76a0d82f09e6418259693beff1b99b895 (patch)
treec65c41f365e0bb3dc1cbc84f616919f33b8b4fb9 /usr.sbin/ntpd/ntp.c
parentc406fbe0f0bbe6acad773e991b8c334e7297f4c2 (diff)
Compensate old offsets with the amount of adjustment done, avoiding
overcompensating. From DragonFly, uses recent adjtime(2) changes, so you'll need a recent kernel. ok henning@
Diffstat (limited to 'usr.sbin/ntpd/ntp.c')
-rw-r--r--usr.sbin/ntpd/ntp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 4657f6f09c1..8ee2a981027 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.83 2006/06/04 18:58:13 otto Exp $ */
+/* $OpenBSD: ntp.c,v 1.84 2006/06/07 06:29:03 otto Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -500,8 +500,11 @@ priv_adjtime(void)
free(offsets);
- TAILQ_FOREACH(p, &conf->ntp_peers, entry)
+ TAILQ_FOREACH(p, &conf->ntp_peers, entry) {
+ for (i = 0; i < OFFSET_ARRAY_SIZE; i++)
+ p->reply[i].offset -= offset_median;
p->update.good = 0;
+ }
return (0);
}
@@ -551,6 +554,7 @@ priv_host_dns(char *name, u_int32_t peerid)
void
update_scale(double offset)
{
+ offset += getoffset();
if (offset < 0)
offset = -offset;