From a608496fafb22f27fed8175cb04d265de51df9b3 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 26 Mar 2020 11:51:17 +0100 Subject: [PATCH] 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") --- ntp_sources.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntp_sources.c b/ntp_sources.c index dfdcff2..e38839f 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();