Browse Source

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
OPENBSD_3_8
henning 19 years ago
parent
commit
90903372f9
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/usr.sbin/ntpd/ntp.c

+ 5
- 3
src/usr.sbin/ntpd/ntp.c View File

@ -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 <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -460,8 +460,10 @@ priv_settime(double offset)
conf->settime = 0; conf->settime = 0;
TAILQ_FOREACH(p, &conf->ntp_peers, entry) { 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;
} }
} }


Loading…
Cancel
Save