[ntp:questions] ntpd sets clock to the year 1939 (Was: Re: questions Digest, Vol 29, Issue 78)

Per Hedeland per at hedeland.org
Wed Mar 28 06:30:17 UTC 2007

In article
<4B73D9EBE2327E40B4D69822D7C45802068D0886 at sjmail1.symmetricom.com>
GDowd at symmetricom.com (Greg Dowd) writes:
>That's cool that you tested this.  Guess I better do the same :-)  I
>sometimes wish Dave had a larger ego and would opine about the great
>stuff that he adds into the codebase.  I assume some radixing code has
>been added to systime?  In any case, the original problem was a 34 year
>problem as the difference of 2 timestamps is a signed value (68 years).

The difference can range from -68 to +68 years - sounds like 136 years
to me. But maybe we're just quibbling about terminology - while I
believe this means that the window is 136 years, the more interesting
thing is perhaps that given a window symmetric around current system
time (as ntpd currently uses), the actual time can't be determined
correctly if it is more than 68 years off (and correspondingly for 68
and 34, of course) - as demonstrated by my test with current code.

>Back then, IIRC, the code was adding the results of the two first
>differences (t3-t2) and (t1-t0) BEFORE dividing by 2.  Hence, 34 years.

Ah, this is likely the (only) fix that happened at some point between
4.2.0 and 4.2.4p0.

--Per Hedeland
per at hedeland.org

More information about the questions mailing list