Re: [chrony-dev] Poor way to fix Y2038 on linux |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] Poor way to fix Y2038 on linux
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Wed, 14 Oct 2020 16:16:29 +0200
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlichvar@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602684993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=q0DxJJD7VDJhiwGFasPgge3f0/kRK5LbLb5PKLwCCcg=; b=Hm5toViSkUJzyhXR8rN1thZd/MewlhkflILCCXOwqFCIL02GdcZ6J2bAr42CPaWRBQx8m0 Xu9QFLmYuox1GfTvvC9bvPMWNqbsDzBajO68QYoP9bfZX0Pysm70AeRAogStc6Z8+uRCNC jqUZO+Sjdx1z5JMtWZl2dS22lRfj5D8=
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.