Pivoting (or rather missing pivot)

Hal Murray hmurray at megapathdsl.net
Wed Apr 26 06:54:21 UTC 2017


devel at ntpsec.org said:
> Rather than repeating myself:
> https://lists.ntpsec.org/pipermail/devel/2017-April/004179.html 

Thanks.  Here is the key part:
>         step - double seconds, range usually +/1 1ms, 1us or 1ns.
>                never larger than 'gate', but for arguement assume
>                it could be as large as 1Jan2200 - 1Jan1970

It can be (and often is) larger than gate on the first adjustment when run 
with the -g switch.

2200-1970 is 230.  That doesn't fit into a l_fp so you can't possibly get a 
step size that big.

Consider what happens when the local time is 1970 and the remote server time 
is 2037.  That's the case Eric is interested in.

The 2037 gets truncated so the remote server time comes back as 1901.  
1901-1970 is -69 rather than   +67.

1901 is obviously earlier than the build EPOCH, so bumping step by 1<<32 adds 
136 years and gets the right answer.

If our time were "close enough", say 2000, then 1901-2000 is -99 which 
overflows/underflows and turns into +37.




-- 
These are my opinions.  I hate spam.





More information about the devel mailing list