From: Miroslav Lichvar Date: Thu, 26 Mar 2020 10:51:17 +0000 (+0100) Subject: ntp: fix log message for replaced source X-Git-Tag: 4.0-pre2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a608496fafb22f27fed8175cb04d265de51df9b3;p=thirdparty%2Fchrony.git ntp: fix log message for replaced source 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") --- diff --git a/ntp_sources.c b/ntp_sources.c index dfdcff22..e38839fb 100644 --- a/ntp_sources.c +++ b/ntp_sources.c @@ -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();