Buggy WNRO fixup

Gary E. Miller gem at rellim.com
Wed Dec 29 03:37:58 UTC 2021

Yo Hal!

On Tue, 28 Dec 2021 13:35:33 -0800
Hal Murray <halmurray at sonic.net> wrote:

> > That is the important part.  gpsd handles that just fine:  
> Is there anything tricky about the fixup code?

Nope.  gpsd/timebase.c, line 322.

Here is the meat:

    /* sanity check unix time against leap second.
     * Does not work well with regressions because the leap_sconds
     * could be from the receiver, or from BUILD_LEAPSECONDS.
     * Leap second 18 at 1 Jan 2017: 1483228800
     * (long long) for 32-bit systems */
    if (17 < session->context->leap_seconds &&
        1483228800LL > t.tv_sec) {
        long long old_tv_sec = t.tv_sec;
        t.tv_sec += 619315200LL;                    // fast forward 1024 weeks

Basically, if the GPS reports more the 17 leap seconds, then the time
has to be aster 1 Jan 2017.

The regression tests are dealt with elsewhjere.

> I was expecting a few lines of code.  The existing code is much much
> more complicated than that.

I assume you are talking about the NTPsec code.  THat does look excessive.

> Is there any magic not-before date in the ntpsec environment?


> I think we used to have the build date in the version string but that
> was removed to make builds reproducable.  I thought we added
> something in a #define someplace with the idea that it would get
> updated with each release, but I can't find it.

Ditto for gpsd.

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20211228/5f4ab4ca/attachment.bin>

More information about the devel mailing list