✘esterror
Gary E. Miller
gem at rellim.com
Tue Oct 11 17:40:50 UTC 2016
Yo Eric!
On Tue, 11 Oct 2016 06:47:51 -0400
"Eric S. Raymond" <esr at thyrsus.com> wrote:
> > esterror is a long of micro sec:
>
> That cast looks wrong. So does the one on the line following. I've
> changed it to cast to long.
A mere long is not big enough on a 32 bit machine. That just leaves
31 bits of digits when ntpd is running 20 bits of nano sec and (soon)
32 bits of seconds. Not gonna happen often, but it will overflow.
> As Hal says, the microsecond unit is a wired-in property of the API.
> We can't fix that.
We got to. Notice in ntpd/ntp_control.c that esterror can be micro sec
or nanosec depending on
line 1420: # ifdef STA_NANO
But in ntp_loopfilter.c it is forced to micro secc:
line 1404: ntv.esterror = (uint32_t)(clock_jitter * 1e6);
So it is already broken. We can fir the internals, and still keep the
API.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem at rellim.com Tel:+1 541 382 8588
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ntpsec.org/pipermail/devel/attachments/20161011/50800da1/attachment.bin>
More information about the devel
mailing list