[chrony-dev] [PATCH v2 6/6] test/unit: add leapdb test

2023-11-29 Thread patrick . oppenlander
From: Patrick Oppenlander --- test/unit/leapdb.c | 118 + 1 file changed, 118 insertions(+) create mode 100644 test/unit/leapdb.c diff --git a/test/unit/leapdb.c b/test/unit/leapdb.c new file mode 100644 index 000..b1b7035 --- /dev/null +++ b/tes

[chrony-dev] [PATCH v2 5/6] leapdb: support leap-seconds.list as second source

2023-11-29 Thread patrick . oppenlander
From: Patrick Oppenlander The existing implementation of getting leap second information from a timezone in get_tz_leap() relies on non-portable C library behaviour. Specifically, mktime is not required to return '60' in the tm_sec field when a leap second is inserted leading to "Timezone right/

[chrony-dev] [PATCH v2 4/6] leapdb: store data source in a function pointer

2023-11-29 Thread patrick . oppenlander
From: Patrick Oppenlander Instead of testing whether leap_tzname is set, use a function pointer to store the leap second data source. Doing this reduces the scope of changes required to add another leap second source to LDB_Initialise(). --- leapdb.c | 16 +--- 1 file changed, 9 ins

[chrony-dev] [PATCH v2 3/6] leapdb: move source check into separate function

2023-11-29 Thread patrick . oppenlander
From: Patrick Oppenlander The sanity checks are valid for all possible sources of leap second information, so move them into a separate function check_leap_source(). --- leapdb.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/leapdb.c b/l

[chrony-dev] [PATCH v2 2/6] leapdb: make twice per day check logic common

2023-11-29 Thread patrick . oppenlander
From: Patrick Oppenlander We want to do the twice per day check regardless of the data source. Move the check up one level from get_tz_leap() into LDB_GetLeap(). --- leapdb.c | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/leapdb.c

[chrony-dev] [PATCH v2 1/6] reference: move leap second source into leapdb

2023-11-29 Thread patrick . oppenlander
From: Patrick Oppenlander Separate out source of leap second data into a new module in preparation for supporting more sources such as leap-seconds.list. --- Makefile.in | 2 +- leapdb.c| 147 leapdb.h| 37 + main.c

[chrony-dev] [PATCH v2 0/6] support leap-seconds.list

2023-11-29 Thread patrick . oppenlander
From: Patrick Oppenlander Hi Miroslav, here's a new patch series addressing your initial feedback. Changes from v1: * Add a new leapdb module with unit test. * Make 12 hour caching logic common. * Make sanity checking logic common. * Don't cache leap-seconds.list contents between calls. * Namin

Re: [chrony-dev] [PATCH 1/1] reference: support leap-seconds.list leap second source

2023-11-29 Thread Patrick Oppenlander
Hi Miroslav, On Wed, Nov 29, 2023 at 9:05 PM Miroslav Lichvar wrote: > > On Wed, Nov 29, 2023 at 11:15:59AM +1100, patrick.oppenlan...@gmail.com wrote: > > This patch adds support for getting leap second information from the > > leap-seconds.list file included with tzdata and adds a new configura

Re: [chrony-dev] Chrony and leap-second table expiration

2023-11-29 Thread Patrick Oppenlander
Hi Paul, On Thu, Nov 30, 2023 at 6:38 AM Paul Eggert wrote: > > The TZDB mailing list has recently been wrestling with the topic of > leap-second table expiration (see [1] and [2] for some of this). > > Here's the issue. The leap-seconds.list file, maintained by Judah Levine > of NIST and redistr

[chrony-dev] Chrony and leap-second table expiration

2023-11-29 Thread Paul Eggert
The TZDB mailing list has recently been wrestling with the topic of leap-second table expiration (see [1] and [2] for some of this). Here's the issue. The leap-seconds.list file, maintained by Judah Levine of NIST and redistributed by TZDB, contains a line like this: #@ 3928521600 which

Re: [chrony-dev] [PATCH 1/1] reference: support leap-seconds.list leap second source

2023-11-29 Thread Miroslav Lichvar
On Wed, Nov 29, 2023 at 11:15:59AM +1100, patrick.oppenlan...@gmail.com wrote: > This patch adds support for getting leap second information from the > leap-seconds.list file included with tzdata and adds a new configuration > directive leapsecdb to switch on the feature. Good idea. I have some c