mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 03:55:06 -05:00
ntp: send two presend packets in interleaved mode
In a burst of three requests (two presend + one normal) the server can detect the client is using the interleaved mode and save the transmit timestamp of the second response for the third response. This shortens the interval in which the server has to keep the state.
This commit is contained in:
12
ntp_core.c
12
ntp_core.c
@@ -1050,16 +1050,14 @@ transmit_timeout(void *arg)
|
||||
|
||||
/* Check whether we need to 'warm up' the link to the other end by
|
||||
sending an NTP exchange to ensure both ends' ARP caches are
|
||||
primed. On loaded systems this might also help ensure that bits
|
||||
of the program are paged in properly before we start. */
|
||||
|
||||
primed or whether we need to send two packets first to ensure a
|
||||
server in the interleaved mode has a fresh timestamp for us. */
|
||||
if ((inst->presend_minpoll > 0) &&
|
||||
(inst->presend_minpoll <= inst->local_poll) &&
|
||||
!inst->presend_done) {
|
||||
inst->presend_done = 1;
|
||||
} else {
|
||||
/* Reset for next time */
|
||||
inst->presend_done = 0;
|
||||
inst->presend_done = inst->interleaved ? 2 : 1;
|
||||
} else if (inst->presend_done > 0) {
|
||||
inst->presend_done--;
|
||||
}
|
||||
|
||||
sent = transmit_packet(inst->mode, inst->interleaved, inst->local_poll,
|
||||
|
||||
Reference in New Issue
Block a user