summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-04-18 11:07:56 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-04-18 11:07:56 +0000
commit03a8c3bed966a9d4e14902f8464d35e6d442de82 (patch)
tree0bc9b12e99437d4edcbf5c9326e9f193055ce9a6 /usr.sbin
parent2d2e1ae81e8abca6a3ca390eb69ad6b0c7bf9b78 (diff)
after setting the clock hard correct the "next" and "deadline" timestamps
by the offset From: Joerg Sonnenberger <joerg@britannica.bec.de>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ntpd/ntp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 3be43a51426..a3deac5dfa4 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.55 2005/03/24 14:50:07 henning Exp $ */
+/* $OpenBSD: ntp.c,v 1.56 2005/04/18 11:07:55 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -454,8 +454,15 @@ offset_compare(const void *aa, const void *bb)
void
priv_settime(double offset)
{
+ struct ntp_peer *p;
+
imsg_compose(ibuf_main, IMSG_SETTIME, 0, 0, &offset, sizeof(offset));
conf->settime = 0;
+
+ TAILQ_FOREACH(p, &conf->ntp_peers, entry) {
+ p->next -= (time_t)offset;
+ p->deadline -= (time_t) offset;
+ }
}
void