From: Siavash Tavakoli Date: Thu, 30 Sep 2021 11:49:31 +0000 (+0100) Subject: login-common: Change login proxy message to include IP address X-Git-Tag: 2.3.18~187 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32e57666dcafb4ff3a4c77c75cbc86382e1fbd84;p=thirdparty%2Fdovecot%2Fcore.git login-common: Change login proxy message to include IP address Will be in format " ()". Host part is optional and not added if proxy target is an IP address. --- diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index d776083c2b..2d4346c3bb 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -296,8 +296,13 @@ void client_proxy_finish_destroy_client(struct client *client) /* Include hostname in the log message in case it's different from the IP address in the prefix. */ - str_printfa(str, "Started proxying to %s", - login_proxy_get_host(client->login_proxy)); + const char *ip_str = login_proxy_get_ip_str(client->login_proxy); + const char *host = login_proxy_get_host(client->login_proxy); + str_printfa(str, "Started proxying to <%s>", + login_proxy_get_ip_str(client->login_proxy)); + if (strcmp(ip_str, host) != 0) + str_printfa(str, " (<%s>)", host); + client_proxy_append_conn_info(str, client); login_proxy_append_success_log_info(client->login_proxy, str);