fix: missing net to host conversion of port in logging

This commit is contained in:
Green Sky 2022-10-01 20:16:12 +02:00
parent fb99aea9e3
commit 8054854b58
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
ed8c226b4a7a95dacfb6170d351ff5e7440a848749e9d0527f85ea7f7a6d3924 /usr/local/bin/tox-bootstrapd
e94176c6c2aa1f2bdb1e17cedd2e0df91a88c6897b89a5447ca587ec99edbfad /usr/local/bin/tox-bootstrapd

View File

@ -1734,7 +1734,7 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port)
} else {
Ip_Ntoa ip_str;
LOGGER_ERROR(log, "cannot connect to %s:%d which is neither IPv4 nor IPv6",
net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port);
net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port));
return false;
}
@ -1746,7 +1746,7 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port)
Ip_Ntoa ip_str;
LOGGER_DEBUG(log, "connecting socket %d to %s:%d",
(int)sock.sock, net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port);
(int)sock.sock, net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port));
errno = 0;
if (connect(sock.sock, (struct sockaddr *)&addr, addrsize) == -1) {
@ -1756,7 +1756,7 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port)
if (!should_ignore_connect_error(error)) {
char *net_strerror = net_new_strerror(error);
LOGGER_ERROR(log, "failed to connect to %s:%d: %d (%s)",
net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port, error, net_strerror);
net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port), error, net_strerror);
net_kill_strerror(net_strerror);
return false;
}