mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-29 13:20:09 +00:00
Fixed wrong endianess of port in bind() and connect() broken with the last commit
This commit is contained in:
parent
1f4b814d0b
commit
7385449f33
@ -495,9 +495,9 @@ lwip_bind(int s, const struct sockaddr *name, socklen_t namelen)
|
||||
SOCKADDR_TO_IPXADDR_PORT((name->sa_family == AF_INET6), name, &local_addr, local_port);
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d, addr=", s));
|
||||
ipX_addr_debug_print(name->sa_family == AF_INET6, SOCKETS_DEBUG, &local_addr);
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", ntohs(local_port)));
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", local_port));
|
||||
|
||||
err = netconn_bind(sock->conn, ipX_2_ip(&local_addr), ntohs(local_port));
|
||||
err = netconn_bind(sock->conn, ipX_2_ip(&local_addr), local_port);
|
||||
|
||||
if (err != ERR_OK) {
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) failed, err=%d\n", s, err));
|
||||
@ -567,9 +567,9 @@ lwip_connect(int s, const struct sockaddr *name, socklen_t namelen)
|
||||
SOCKADDR_TO_IPXADDR_PORT((name->sa_family == AF_INET6), name, &remote_addr, remote_port);
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d, addr=", s));
|
||||
ipX_addr_debug_print(name->sa_family == AF_INET6, SOCKETS_DEBUG, &remote_addr);
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", ntohs(remote_port)));
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", remote_port));
|
||||
|
||||
err = netconn_connect(sock->conn, ipX_2_ip(&remote_addr), ntohs(remote_port));
|
||||
err = netconn_connect(sock->conn, ipX_2_ip(&remote_addr), remote_port);
|
||||
}
|
||||
|
||||
if (err != ERR_OK) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user