]> git.ipfire.org Git - thirdparty/chrony.git/commit
ntp: make sure new configuration IDs are unused
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 29 Jul 2024 12:33:14 +0000 (14:33 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 30 Jul 2024 10:11:09 +0000 (12:11 +0200)
commit66512ebcb362ac5f5d55c087a8f39872aa1b0edf
tree165b23adc06e88cfa298c6a0f8b396c1070a8203
parent3940d2aae344953c6432c5b5d26b87f0bfaf60cb
ntp: make sure new configuration IDs are unused

The configuration IDs assigned to individual sources (used when they
don't have a resolved IP address) and pools of sources are 32-bit. The
ID could overflow if some sources were very frequently removed and added
again. Two unrelated sources could end up with the same ID, causing some
operations to unexpectedly impact only one or both sources.

Make sure the ID is currently unused before assigning it to a new source.
ntp_sources.c