From: Miroslav Lichvar Date: Tue, 4 May 2021 09:49:54 +0000 (+0200) Subject: source: don't print duplicated address in selection message X-Git-Tag: 4.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb9ba3e4bd31692674cb0ff1fcfe8ff6c1f05edb;p=thirdparty%2Fchrony.git source: don't print duplicated address in selection message Don't print the original IP address in parentheses in the "Selected source ..." message if it is identical to the current address. That is expected to be the usual case for sources specified by IP address. --- diff --git a/sources.c b/sources.c index 895172e7..ce0965f3 100644 --- a/sources.c +++ b/sources.c @@ -589,7 +589,7 @@ log_selection_source(const char *format, SRC_Instance inst) name = source_to_string(inst); ntp_name = inst->type == SRC_NTP ? NSR_GetName(inst->ip_addr) : NULL; - if (ntp_name) + if (ntp_name && strcmp(name, ntp_name) != 0) snprintf(buf, sizeof (buf), "%s (%s)", name, ntp_name); else snprintf(buf, sizeof (buf), "%s", name);