]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: fix log message for replaced source
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 26 Mar 2020 10:51:17 +0000 (11:51 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 26 Mar 2020 14:26:58 +0000 (15:26 +0100)
When a source was replaced and the new source had the same slot as the
old source, a wrong message was logged. Fix the condition to distinguish
correctly between changed address and port.

Fixes: 9468fd4aa680 ("ntp: allow changing port of source")
ntp_sources.c

index dfdcff22cb382438d73a5df63aa701de2e81fe33..e38839fb4c2be24cdbbaf433bfeaf7b2c2857b2f 100644 (file)
@@ -381,7 +381,7 @@ change_source_address(NTP_Remote_Address *old_addr, NTP_Remote_Address *new_addr
   name = record->name;
   severity = UTI_IsIPReal(&old_addr->ip_addr) ? LOGS_INFO : LOGS_DEBUG;
 
-  if (slot1 != slot2) {
+  if (found == 0) {
     /* The hash table must be rebuilt for the changed address */
     rehash_records();