Re: [chrony-dev] Poor way to fix Y2038 on linux

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Wed, Oct 14, 2020 at 03:55:40PM +0200, Mirek sic wrote:
> y2038_offset = 883612800
> 
> memcpy(&off_recalc, &server->offset, 4);
> off_recalc -= y2038_offset;
> memcpy(&server->offset, &off_recalc, 4);

> After this big into. I want to ask for advice how to modify chrony to use
> the same offset in system time like in ntpdate case?

If you don't mind that it will reduce the resolution of the offset to
about 120 ns, you can use the offset option in chrony.conf, e.g.

server foo.example.net iburst offset -883612800

If you don't want to lose the resolution (you are using HW
timestamping), you will need to modify the process_response() function
in ntp_core.c to apply this correction to the timespec values, before
they are converted to double, e.g. add the following line:

remote_average.tv_sec -= 883612800;

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/