From: Miroslav Lichvar Date: Thu, 18 Jul 2019 09:33:13 +0000 (+0200) Subject: ntp: improve debug messages with port number X-Git-Tag: 4.0-pre1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d78680912e6ea476257d533bf00362e2827f8997;p=thirdparty%2Fchrony.git ntp: improve debug messages with port number --- diff --git a/ntp_core.c b/ntp_core.c index 49d1ae73..8ac7e0dc 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -914,8 +914,7 @@ receive_timeout(void *arg) { NCR_Instance inst = (NCR_Instance)arg; - DEBUG_LOG("Receive timeout for [%s:%d]", - UTI_IPToString(&inst->remote_addr.ip_addr), inst->remote_addr.port); + DEBUG_LOG("Receive timeout for %s", UTI_IPSockAddrToString(&inst->remote_addr)); inst->rx_timeout_id = 0; close_client_socket(inst); @@ -1172,8 +1171,7 @@ transmit_timeout(void *arg) return; } - DEBUG_LOG("Transmit timeout for [%s:%d]", - UTI_IPToString(&inst->remote_addr.ip_addr), inst->remote_addr.port); + DEBUG_LOG("Transmit timeout for %s", UTI_IPSockAddrToString(&inst->remote_addr)); /* Open new client socket */ if (inst->mode == MODE_CLIENT) { @@ -2103,9 +2101,8 @@ NCR_ProcessRxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a return; if (!ADF_IsAllowed(access_auth_table, &remote_addr->ip_addr)) { - DEBUG_LOG("NTP packet received from unauthorised host %s port %d", - UTI_IPToString(&remote_addr->ip_addr), - remote_addr->port); + DEBUG_LOG("NTP packet received from unauthorised host %s", + UTI_IPToString(&remote_addr->ip_addr)); return; } diff --git a/ntp_io.c b/ntp_io.c index 48de7247..58479563 100644 --- a/ntp_io.c +++ b/ntp_io.c @@ -433,8 +433,7 @@ NIO_SendPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr, assert(initialised); if (local_addr->sock_fd == INVALID_SOCK_FD) { - DEBUG_LOG("No socket to send to %s:%d", - UTI_IPToString(&remote_addr->ip_addr), remote_addr->port); + DEBUG_LOG("No socket to send to %s", UTI_IPSockAddrToString(remote_addr)); return 0; }