Re: [chrony-dev] [PATCH v2 2/2] refclock: Add a new "tai" option |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH v2 2/2] refclock: Add a new "tai" option
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Wed, 11 Oct 2017 16:55:13 +0200
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=mlichvar@xxxxxxxxxx
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DD62C13A49
On Tue, Oct 10, 2017 at 01:23:21PM -0400, Chris Perl wrote:
> + if (instance->tai) {
> + tai_offset = REF_GetTaiOffset(sample_time);
It turned out, this doesn't actually handle the case I mentioned
before. We want to get the offset for the reference time, not the
local system time. For instance, if chronyd was started with local
clock in year 2000, it should apply the current TAI-UTC offset and not
the one from 2000. It seems this requires two separate calls of
REF_GetTaiOffset(). One to get an approximate reference time in UTC
and then get the actual TAI-UTC offset.
I'll apply your patches with some minor modifications and add the
improved conversion in a separate commit.
Thanks!
> + if (!tai_offset) {
> + DEBUG_LOG("refclock sample ignored unknown TAI offset");
> + return 0;
> + }
> +
> + /* REF_GetTaiOffset returns the number of leap seconds that have
> + been inserted into UTC. To get from TAI to UTC, we have to
> + remove those seconds from the sample */
Strictly speaking, the offset between TAI and UTC is not the number of
leap seconds that have been applied so far. The offset already started
at 10. I'll just remove the comment.
--
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.