[ntp:questions] ntpd, boot time, and hot plugging

brad at shub-internet.org brad at shub-internet.org
Tue Feb 15 09:50:49 UTC 2005

"David L. Mills" <mills at udel.edu> wrote:

>                                               The only thing the -g
> option does is allow one and only one panic correction. Tinkering the
> panic threshold to zero completely disables the panic function, as
> panics will never occur and the -g option has no effect.

I was looking at ntpd/ntp_loopfilter.c, and got confused by this comment,
starting at line 234:

         * If the clock is way off, panic is declared. The clock_panic
         * defaults to 1000 s; if set to zero, the panic will never
         * occur. The allow_panic defaults to FALSE, so the first panic
         * will exit. It can be set TRUE by a command line option, in
         * which case the clock will be set anyway and time marches on.
         * But, allow_panic will be set FALSE when the update is less
         * than the step threshold; so, subsequent panics will exit.

I never claimed to grok what the code itself was actually doing, but my
reading of that comment does not correspond with the explanation you just
gave.  Can you clarifiy?

> In general, the 34-year limit is due to integer overflow of the
> first-order differences of 64-bit timestamps. This is documented in a
> white paper on the NTP project page. However, a change made early last
> year extened that limit to 68 years. This was done by converting the
> first-order differences to floating double before the second-order
> differences are computed. You can resume breathing now.

When was this done?  Just a few days ago, I had the system come up with a
bogus BIOS clock date set to 1 Jan 1970, and after sync'ing to upstream
time servers, ntpd reset my clock to something in 1934.  I'd like to know
when this change went in, so that I would have some idea of what might have
happened on my system if it was not the fault of ntpd having an overflow

Brad Knowles, <brad at stop.mail-abuse.org>

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
    -Benjamin Franklin, Historical Review of Pennsylvania.

  SAGE member since 1995.  See <http://www.sage.org/> for more info.

More information about the questions mailing list