]> git.ipfire.org Git - thirdparty/chrony.git/commit
ntp: save response when waiting for HW TX timestamp
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 28 Mar 2023 13:33:50 +0000 (15:33 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 30 Mar 2023 13:44:19 +0000 (15:44 +0200)
commit0189dac7d82f89de9be07a29985371efa686637d
tree7591b761f94e7b12e2e809872af625d59c88ef48
parent4a11399c2ebb78c9de8b4fca256d00b82416ff32
ntp: save response when waiting for HW TX timestamp

Rework handling of late HW TX timestamps. Instead of suspending reading
from client-only sockets that have HW TX timestamping enabled, save the
whole response if it is valid and a HW TX timestamp was received for the
source before. When the timestamp is received, or the configurable
timeout is reached, process the saved response again, but skip the
authentication test as the NTS code allows only one response per
request. Only one valid response per source can be saved. If a second
valid response is received while waiting for the timestamp, process both
responses immediately in the order they were received.

The main advantage of this approach is that it works on all sockets, i.e.
even in the symmetric mode and with NTP-over-PTP, and the kernel does
not need to buffer invalid responses.
doc/chrony.conf.adoc
ntp_core.c
ntp_io.c
ntp_io_linux.c
ntp_io_linux.h
test/unit/ntp_core.c