ws2_32: Fix FreeBSD compiling issue on ipx address structure

Francois Gouget fgouget at
Mon Jan 6 04:55:30 CST 2014

On Sun, 5 Jan 2014, Bruno Jesus wrote:

> Manually tested on PC-BSD which also shows the issue.

I think it would even work to compare sipx_network and sipx_node in one 
go. There is already code that copies them that way in 

So we could do (compiles but not tested):

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 0391554..a92c5c3 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1473,7 +1473,10 @@ static BOOL is_sockaddr_bound(const struct 
sockaddr *uaddr, int uaddrlen)
             static const struct sockaddr_ipx emptyAddr;
             struct sockaddr_ipx *ipx = (struct sockaddr_ipx*) uaddr;
-            return ipx->sipx_port || ipx->sipx_network || memcmp(&ipx->sipx_node, &emptyAddr.sipx_node, sizeof(emptyAddr.sipx_node));
+            /* compare sipx_network and sipx_node in one go to ease portability */
+            return ipx->sipx_port ||
+                memcmp(&ipx->sipx_network, &emptyAddr.sipx_network, sizeof(emptyAddr.sipx_network) + sizeof(emptyAddr.sipx_node));
         case AF_INET6:

But your patch works too.

Francois Gouget <fgouget at>    
             Research is the transformation of money to knowledge.
            Innovation is the transformation of knowledge to money.
                              -- Dr. Hans Meixner

More information about the wine-devel mailing list