# %%%% date: 2003/05/08 08:22:08; state: Exp; lines: +1 -1 # fix-create-inet-socket # SEVERE BUG FIXED! It was impossible to connect using osl_socket series # of functions on x86 since port was not converted to network byte order when # opening a socket! Old implementation of "File->send->as email" # (that didn't use external MUA, - i.e. in OO627 or something ancient like # this) would work after that fix. # # It's obvious for any programmer who knows POSIX how unusual for anybody # who ever wrote networking code that was ever run on x86 CPUs (and others # with the same byte endianess) to make such mistakes. Index: oo/sal/osl/unx/socket.c diff -u oo/sal/osl/unx/socket.c:1.1 oo/sal/osl/unx/socket.c:1.2 --- oo/sal/osl/unx/socket.c:1.1 Mon Apr 28 21:43:15 2003 +++ oo/sal/osl/unx/socket.c Thu May 8 13:22:08 2003 @@ -572,7 +572,7 @@ pInetAddr->sin_family = FAMILY_TO_NATIVE(osl_Socket_FamilyInet); pInetAddr->sin_addr.s_addr = nAddr; - pInetAddr->sin_port = (sal_uInt16)(port&0xffff); + pInetAddr->sin_port = htons((sal_uInt16)(port&0xffff)); break; } default: