From 90903372f98be2f3f1503c9d0668685873594512 Mon Sep 17 00:00:00 2001 From: henning <> Date: Mon, 18 Apr 2005 14:12:50 +0000 Subject: [PATCH] correctness: only account for offset after settime in next and deadline when those timers are actually running. due to the way ntpd's logic works this does not really make a difference, but correctness is good. spotted by me, joerg agrees --- src/usr.sbin/ntpd/ntp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sbin/ntpd/ntp.c index a3deac5d..a082f191 100644 --- a/src/usr.sbin/ntpd/ntp.c +++ b/src/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.56 2005/04/18 11:07:55 henning Exp $ */ +/* $OpenBSD: ntp.c,v 1.57 2005/04/18 14:12:50 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -460,8 +460,10 @@ priv_settime(double offset) conf->settime = 0; TAILQ_FOREACH(p, &conf->ntp_peers, entry) { - p->next -= (time_t)offset; - p->deadline -= (time_t) offset; + if (p->next) + p->next -= offset; + if (p->deadline) + p->deadline -= offset; } }