@@ -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