diff options
author | Chris Kuethe <ckuethe@cvs.openbsd.org> | 2008-05-16 06:13:26 +0000 |
---|---|---|
committer | Chris Kuethe <ckuethe@cvs.openbsd.org> | 2008-05-16 06:13:26 +0000 |
commit | fa67220575e71eb3b1ac9008b54838c96465dc35 (patch) | |
tree | ed549ac5eba38d4b77ae1529d26f7cf37bbeafb0 | |
parent | b9927a17432281d5b8ef45d4b774c884a9dd8c3c (diff) |
Allow ntpd to step the time at startup, now matter how large or small the
offset. The 180s limit doesn't help very much these days.
ok otto@ mbalmer@
-rw-r--r-- | usr.sbin/ntpd/ntpd.8 | 7 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 6 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntpd.h | 3 |
3 files changed, 5 insertions, 11 deletions
diff --git a/usr.sbin/ntpd/ntpd.8 b/usr.sbin/ntpd/ntpd.8 index e7dcf13e588..73d766b80ce 100644 --- a/usr.sbin/ntpd/ntpd.8 +++ b/usr.sbin/ntpd/ntpd.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ntpd.8,v 1.23 2007/12/11 11:26:27 jmc Exp $ +.\" $OpenBSD: ntpd.8,v 1.24 2008/05/16 06:13:24 ckuethe Exp $ .\" .\" Copyright (c) 2003, 2004, 2006 Henning Brauer <henning@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 11 2007 $ +.Dd $Mdocdate: May 16 2008 $ .Dt NTPD 8 .Os .Sh NAME @@ -60,8 +60,7 @@ Only check the configuration file for validity. Do not set the time immediately at startup. This is the default. .It Fl s -Set the time immediately at startup if the local clock is off by more -than 180 seconds. +Set the time immediately at startup. Allows for a large time correction, eliminating the need to run .Xr rdate 8 diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index 9cfbc2b14a9..89012f4cf34 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.59 2008/05/14 09:32:18 pyr Exp $ */ +/* $OpenBSD: ntpd.c,v 1.60 2008/05/16 06:13:25 ckuethe Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -411,10 +411,6 @@ ntpd_settime(double d) char buf[80]; time_t tval; - /* if the offset is small, don't call settimeofday */ - if (d < SETTIME_MIN_OFFSET && d > -SETTIME_MIN_OFFSET) - return; - if (gettimeofday(&curtime, NULL) == -1) { log_warn("gettimeofday"); return; diff --git a/usr.sbin/ntpd/ntpd.h b/usr.sbin/ntpd/ntpd.h index 323ca05e21c..2c076fa777b 100644 --- a/usr.sbin/ntpd/ntpd.h +++ b/usr.sbin/ntpd/ntpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.h,v 1.91 2008/01/28 11:45:59 mpf Exp $ */ +/* $OpenBSD: ntpd.h,v 1.92 2008/05/16 06:13:25 ckuethe Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -54,7 +54,6 @@ #define QUERYTIME_MAX 15 /* single query might take n secs max */ #define OFFSET_ARRAY_SIZE 8 #define SENSOR_OFFSETS 7 -#define SETTIME_MIN_OFFSET 180 /* min offset for settime at start */ #define SETTIME_TIMEOUT 15 /* max seconds to wait with -s */ #define LOG_NEGLIGEE 32 /* negligible drift to not log (ms) */ #define FREQUENCY_SAMPLES 8 /* samples for est. of permanent drift */ |