Skip to content

Commit

Permalink
fix: missing net to host conversion of port in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Oct 1, 2022
1 parent fb99aea commit 8054854
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ed8c226b4a7a95dacfb6170d351ff5e7440a848749e9d0527f85ea7f7a6d3924 /usr/local/bin/tox-bootstrapd
e94176c6c2aa1f2bdb1e17cedd2e0df91a88c6897b89a5447ca587ec99edbfad /usr/local/bin/tox-bootstrapd
6 changes: 3 additions & 3 deletions toxcore/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit 8054854

Please sign in to comment.