]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: make default NTP version with xleave to be always 4
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 22 Nov 2021 15:44:24 +0000 (16:44 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 22 Nov 2021 16:03:40 +0000 (17:03 +0100)
If the xleave option is enabled, ignore the key option and the hash
length. Always use version 4 as the default to get interleaved responses
from new chrony servers.

doc/chrony.conf.adoc
ntp_core.c

index 6f734d2cb3570f550bcb6e9846b21767c99386dc..21a8d752865ffa2962ceea1e21e36488ea490a14 100644 (file)
@@ -273,10 +273,11 @@ sources are unreachable.
 *version* _version_:::
 This option sets the NTP version of packets sent to the server. This can be
 useful when the server runs an old NTP implementation that does not respond to
-requests using a newer version. The default version depends on whether a key is
-specified by the *key* option and which authentication hash function the key
-is using. If the output size of the hash function is longer than 160 bits, the
-default version is 3 for compatibility with older *chronyd* servers. Otherwise,
+requests using a newer version. The default version depends on other options.
+If the *extfield* or *xleave* option is used, the default version is 4. If
+those options are not used and the *key* option specifies a key using a hash
+function with output size longer than 160 bits (e.g. SHA256), the default
+version is 3 for compatibility with older *chronyd* servers. In other cases,
 the default version is 4.
 *copy*:::
 This option specifies that the server and client are closely related, their
index a0ed65101c06a8764ac752f7b9aee0a74a25d6d1..945aec99f430c473840156036245cedf011f640f 100644 (file)
@@ -620,7 +620,7 @@ NCR_CreateInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type,
     result->auth = NAU_CreateNoneInstance();
   }
 
-  if (result->ext_field_flags)
+  if (result->ext_field_flags || result->interleaved)
     result->version = NTP_VERSION;
   else
     result->version = NAU_GetSuggestedNtpVersion(result->auth);