[PATCH v2] ntpd: make NTP client and server Y2036/2038-ready
Denys Vlasenko
vda.linux at googlemail.com
Tue Jan 17 15:47:43 UTC 2023
Apologies for a very late reply.
On Fri, Sep 16, 2022 at 3:07 PM Miroslav Lichvar <mlichvar at redhat.com> wrote:
> The 32-bit integer part of the NTP timestamp overflows in year 2036,
> which starts the second NTP era.
> + /* Shift timestamps before 1970 to the second NTP era (2036-2106) */
> + if (lfp.int_partl < OFFSET_1900_1970)
> + ret += (double)UINT_MAX + 1.0;
Shouldn't this be 0xffffffff instead of UINT_MAX?
What you are doing here is treating 0...OFFSET_1900_1970
as if there is a carry bit in int_partl, right?
And int_partl is not unit_t. It's uint32_t. Thus you need to add
(1<<32).
More information about the busybox
mailing list