]> git.ipfire.org Git - thirdparty/chrony.git/commit
ntp: fix presend in interleaved mode
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 21 Nov 2023 06:51:37 +0000 (07:51 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 21 Nov 2023 11:38:41 +0000 (12:38 +0100)
commit2d2642bb8289293832ff585b83ddde6d05f2967d
tree79896c5b5e1dd8fe025557c632a3b5b1f528858c
parent9c6eaccc32563fbc277664e0135c7cefc762bf02
ntp: fix presend in interleaved mode

The presend option in interleaved mode uses two presend requests instead
of one to get an interleaved response from servers like chrony which
delay the first interleaved response due to an optimization saving
timestamps only for clients actually using the interleaved mode.

After commit 0ae6f2485b97 ("ntp: don't use first response in interleaved
mode") the first interleaved response following the two presend
responses in basic mode is dropped as the preferred set of timestamps
minimizing error in delay was already used by the second sample in
basic mode. There are only three responses in the burst and no sample is
accumulated.

Increasing the number of presend requests to three to get a fourth
sample would be wasteful. Instead, allow reusing timestamps of the
second presend sample in basic mode, which is never accumulated.

Reported-by: Aaron Thompson
Fixes: 0ae6f2485b97 ("ntp: don't use first response in interleaved mode")
ntp_core.c
test/simulation/114-presend