]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: fix initial poll to follow non-LAN minimum
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 18 Jul 2022 10:43:13 +0000 (12:43 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 21 Jul 2022 12:17:22 +0000 (14:17 +0200)
If a sub-second polling interval is configured, initialize the local
poll to 0 to avoid a shorter interval between the first and second
request in case no response to the first request is received (in time).

ntp_core.c

index 7a21f5e9ef94efb15797c9eb24749533a36f02f8..cd8b62703613959d3c613152f5f04384edfb9bf5 100644 (file)
@@ -650,7 +650,7 @@ NCR_CreateInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type,
   result->tx_timeout_id = 0;
   result->tx_suspended = 1;
   result->opmode = MD_OFFLINE;
-  result->local_poll = result->minpoll;
+  result->local_poll = MAX(result->minpoll, MIN_NONLAN_POLL);
   result->poll_score = 0.0;
   zero_local_timestamp(&result->local_tx);
   result->burst_good_samples_to_go = 0;