From: Miroslav Lichvar Date: Fri, 30 Jun 2017 09:32:19 +0000 (+0200) Subject: ntp: fix poll interleaving with unsynchronised peers X-Git-Tag: 3.2-pre1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=577290c5bc6e339a883153758a78671c92fdd7de;p=thirdparty%2Fchrony.git ntp: fix poll interleaving with unsynchronised peers Update the remote poll and remote stratum even for unsychronised peers, and handle stratum of 0 as 16, so the peers work with the opposite differences between their strata and can adjust their polling intervals in order to interleave the packets. --- diff --git a/ntp_core.c b/ntp_core.c index fc63c681..11586424 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1575,9 +1575,11 @@ receive_packet(NCR_Instance inst, NTP_Local_Address *local_addr, !UTI_CompareTimespecs(&inst->local_rx.ts, &rx_ts->ts)); if (valid_packet) { + inst->remote_poll = message->poll; + inst->remote_stratum = message->stratum != NTP_INVALID_STRATUM ? + message->stratum : NTP_MAX_STRATUM; + if (synced_packet) { - inst->remote_poll = message->poll; - inst->remote_stratum = message->stratum; inst->tx_count = 0; SRC_UpdateReachability(inst->source, 1); }