summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorChris Kuethe <ckuethe@cvs.openbsd.org>2009-06-06 18:47:20 +0000
committerChris Kuethe <ckuethe@cvs.openbsd.org>2009-06-06 18:47:20 +0000
commit9d1af813bf73cb01fef05e69c0fba11b74eef52c (patch)
tree8a70560e1111c981d1cb9f50974398c2a5d71003 /usr.sbin
parent5eaa062a45831c9b3351361b6328dc318af4d072 (diff)
If ntpd decides the clock has become unsynced, reset the number of saved
time corrections. Once the clock is synced again, start computing a fresh frequency correction. ok henning
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ntpd/ntp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index eb8034e3c79..9ce967d350e 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.112 2009/06/06 18:14:25 pyr Exp $ */
+/* $OpenBSD: ntp.c,v 1.113 2009/06/06 18:47:19 ckuethe Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -527,8 +527,10 @@ priv_adjfreq(double offset)
{
double curtime, freq;
- if (!conf->status.synced)
+ if (!conf->status.synced){
+ conf->freq.samples = 0;
return;
+ }
if (conf->filters & FILTER_ADJFREQ){
conf->filters &= ~FILTER_ADJFREQ;