From 13eef3d691cf555684a2a3ff55c08c1232fdddf2 Mon Sep 17 00:00:00 2001 From: Mike Kaplinskiy Date: Sun, 13 Sep 2009 17:54:54 -0400 Subject: [PATCH] ws2_32: Remember to convert ports to network byte order. --- dlls/ws2_32/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index ab889255fb..c3ee04692f 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4959,7 +4959,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString, ptrPort = strchr(workBuffer, ':'); if(ptrPort) { - ((LPSOCKADDR_IN)lpAddress)->sin_port = (WS_u_short)atoi(ptrPort+1); + ((LPSOCKADDR_IN)lpAddress)->sin_port = htons(atoi(ptrPort+1)); *ptrPort = '\0'; } else @@ -5002,7 +5002,7 @@ INT WINAPI WSAStringToAddressA(LPSTR AddressString, ptrPort = strchr(workBuffer, ']'); if(ptrPort && *(++ptrPort) == ':') { - ((LPSOCKADDR_IN6)lpAddress)->sin6_port = (WS_u_short)atoi(ptrPort+1); + ((LPSOCKADDR_IN6)lpAddress)->sin6_port = htons(atoi(ptrPort+1)); *ptrPort = '\0'; } else