Skip to content

Commit 8054854

Browse files
committed
fix: missing net to host conversion of port in logging
1 parent fb99aea commit 8054854

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ed8c226b4a7a95dacfb6170d351ff5e7440a848749e9d0527f85ea7f7a6d3924 /usr/local/bin/tox-bootstrapd
1+
e94176c6c2aa1f2bdb1e17cedd2e0df91a88c6897b89a5447ca587ec99edbfad /usr/local/bin/tox-bootstrapd

toxcore/network.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port)
17341734
} else {
17351735
Ip_Ntoa ip_str;
17361736
LOGGER_ERROR(log, "cannot connect to %s:%d which is neither IPv4 nor IPv6",
1737-
net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port);
1737+
net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port));
17381738
return false;
17391739
}
17401740

@@ -1746,7 +1746,7 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port)
17461746

17471747
Ip_Ntoa ip_str;
17481748
LOGGER_DEBUG(log, "connecting socket %d to %s:%d",
1749-
(int)sock.sock, net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port);
1749+
(int)sock.sock, net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port));
17501750
errno = 0;
17511751

17521752
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)
17561756
if (!should_ignore_connect_error(error)) {
17571757
char *net_strerror = net_new_strerror(error);
17581758
LOGGER_ERROR(log, "failed to connect to %s:%d: %d (%s)",
1759-
net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port, error, net_strerror);
1759+
net_ip_ntoa(&ip_port->ip, &ip_str), net_ntohs(ip_port->port), error, net_strerror);
17601760
net_kill_strerror(net_strerror);
17611761
return false;
17621762
}

0 commit comments

Comments
 (0)