We need to test leap smearing :)

Fred Wright fw at fwright.net
Thu Dec 22 02:21:39 UTC 2022


On Wed, 21 Dec 2022, Hal Murray via devel wrote:

> Does anybody use it?
> Do any distros build with it enabled?
> Should we add an "#warn untested" to the code?

If some systems need leap-smeared time to get around bugs in their code, 
they should be free to implement an *internal* leap-smeared timescale. 
But leap smearing on the wire is an abomination that ought to be expressly 
prohibited.

Any sane implementation of NTP ought to perform all synchronization on the 
TAI timescale, with conversions between TAI and UTC being part of the I/O. 
Using leap-smeared time on the wire makes this mapping inconsistent.

> static void
> leap_smear_add_offs(l_fp *t) {
>        t += leap_smear.offset;
> }
>
> clang 13 points out:
> ../../ntpd/ntp_proto.c:2210:27: warning: parameter 't' set but not used
> [-Wunused-but-set-parameter]
>
> [If you don't see the bug right away, look harder.]
>
> My normal testing doesn't include smearing.
> This is tickled by option-tester which includes --enable-leap-smear

The MacPorts version offers that as a variant, but I don't know if anyone 
uses it.

Fred Wright


More information about the devel mailing list