From 7385449f333fd080af3d5e8a339fe119e5203b07 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 6 Jul 2011 07:18:06 +0000 Subject: [PATCH] Fixed wrong endianess of port in bind() and connect() broken with the last commit --- src/api/sockets.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index 4e10ea5f..9af71c4e 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -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) {