Browse Source

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@
OPENBSD_4_4
ckuethe 16 years ago
parent
commit
51e14636f6
3 changed files with 5 additions and 11 deletions
  1. +3
    -4
      src/usr.sbin/ntpd/ntpd.8
  2. +1
    -5
      src/usr.sbin/ntpd/ntpd.c
  3. +1
    -2
      src/usr.sbin/ntpd/ntpd.h

+ 3
- 4
src/usr.sbin/ntpd/ntpd.8 View File

@ -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> .\" 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 .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" 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 .Dt NTPD 8
.Os .Os
.Sh NAME .Sh NAME
@ -60,8 +60,7 @@ Only check the configuration file for validity.
Do not set the time immediately at startup. Do not set the time immediately at startup.
This is the default. This is the default.
.It Fl s .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, Allows for a large time correction,
eliminating the need to run eliminating the need to run
.Xr rdate 8 .Xr rdate 8


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

@ -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> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -411,10 +411,6 @@ ntpd_settime(double d)
char buf[80]; char buf[80];
time_t tval; 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) { if (gettimeofday(&curtime, NULL) == -1) {
log_warn("gettimeofday"); log_warn("gettimeofday");
return; return;


+ 1
- 2
src/usr.sbin/ntpd/ntpd.h View File

@ -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> * 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 QUERYTIME_MAX 15 /* single query might take n secs max */
#define OFFSET_ARRAY_SIZE 8 #define OFFSET_ARRAY_SIZE 8
#define SENSOR_OFFSETS 7 #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 SETTIME_TIMEOUT 15 /* max seconds to wait with -s */
#define LOG_NEGLIGEE 32 /* negligible drift to not log (ms) */ #define LOG_NEGLIGEE 32 /* negligible drift to not log (ms) */
#define FREQUENCY_SAMPLES 8 /* samples for est. of permanent drift */ #define FREQUENCY_SAMPLES 8 /* samples for est. of permanent drift */


Loading…
Cancel
Save