OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: CVS: cvs.openbsd.org: src

From: Henning Brauer (henningopenbsd.org)
Date: Sun Jun 19 2005 - 12:16:30 CDT


* Theo de Raadt <deraadtcvs.openbsd.org> [2005-06-19 19:00]:
> -s is the choice people can make
>
> without a net, if you start ntpd, it stalls for 45 seconds

15 is the timeout the parent process enforces. since dns lookups and
such run in the client process it cannot really interfere.
I don't see how it can ever be more, nor did I ever see more.
well, actually I just see onbe possibility how it could take slightly
longer, but nowhere near 45 seconds.

not using -s, i. e. not (at least trying to) set the clock hard at
system startup, is very bad since it can leave your clock so far off
that adjtime() can't cope (or it takes weeks) and so your clock stays
off.

the timeout can be shortened, and i ask people to try this diff please:

Index: ntpd.h
===================================================================
RCS file: /cvs/src/usr.sbin/ntpd/ntpd.h,v
retrieving revision 1.57
diff -u -p -r1.57 ntpd.h
--- ntpd.h 19 Jun 2005 17:11:13 -0000 1.57
+++ ntpd.h 19 Jun 2005 17:13:41 -0000
-55,7 +55,7
 #define QUERYTIME_MAX 15 /* single query might take n secs max */
 #define OFFSET_ARRAY_SIZE 8
 #define SETTIME_MIN_OFFSET 180 /* min offset for settime at start */
-#define SETTIME_TIMEOUT 15 /* max seconds to wait with -s */
+#define SETTIME_TIMEOUT 2 /* max seconds to wait with -s */
 #define LOG_NEGLIGEE 128 /* negligible drift to not log (ms) */
 
 enum client_state {