Re: ntpd:support adjusting initial time = y2k36 on 32-bit time_t platforms

2015-03-27 Thread Brent Cook
On Mon, Mar 23, 2015 at 10:42 AM, Alexey Suslikov alexey.susli...@gmail.com wrote: Brent Cook busterb at gmail.com writes: + T4 += (uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec; snip + return ((uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec); snip

Re: ntpd:support adjusting initial time = y2k36 on 32-bit time_t platforms

2015-03-23 Thread Alexey Suslikov
Brent Cook busterb at gmail.com writes: + T4 += (uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec; snip + return ((uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec); snip Can gettime_from_timeval be used over the code instead of repeating same chunk? T4 +=

ntpd:support adjusting initial time = y2k36 on 32-bit time_t platforms

2015-03-21 Thread Brent Cook
This came up in the OpenNTPD issue tracker: https://github.com/openntpd-portable/openntpd-openbsd/pull/4 The issue is an overflow when calculating time offsets with a 32-bit time_t in early 2036. The main reason to fix it in now, in 2015, is that OpenNTPD fails to adjust time if such a system