I realize it's been some time since I've submitted something for the networking problems with the C&C games, but I believe I've come up with something that resolves the major show-stopping issue that was discussed previously. Here is the original thread, for reference: http://www.winehq.org/pipermail/wine-devel/2009-October/079099.html
Specifically, this set of patches is revised to address the problem of throwing away packets destined for the incorrect interface in a multi-threaded/multi-process environment. The approach used here is to create a global (named) POSIX.1-2001 semaphore for each socket with the form wine-ifacelock-FD , where "FD" is the Unix file descriptor corresponding to the socket at hand. These semaphores are only created for UDP sockets bound to a specific interface and are locked/unlocked by both the Wine user-space and the Wine server.
These patches are against wine-1.3.3 and are split apart according to function. The most revised portions since the original set are 2/6 (server-side creation of semaphore), 3/6 (locking and unlocking), and 6/6 (server-side locking and unlocking). If I could get some feedback on these patches then I would greatly appreciate it, it'd be really nice to finally get this issue resolved. Thanks in advance!
[1/6] ws2_32/tests: Add UDP broadcast tests: http://www.compholio.com/wine-kane/patches/2010-09-18/0001-ws2_32-tests-Add-... [2/6] server: Add mechanism for storing an interface ID with a socket: http://www.compholio.com/wine-kane/patches/2010-09-18/0002-server-Add-mechan... [3/6] ws2_32: Patch to selectively bind to interfaces while still allowing broadcast packets: http://www.compholio.com/wine-kane/patches/2010-09-18/0003-ws2_32-Patch-to-s... [4/6] ws2_32: Ensure select does not wake up on packets with an interface mismatch: http://www.compholio.com/wine-kane/patches/2010-09-18/0004-ws2_32-Ensure-sel... [5/6] ws2_32: Ensure Async WSARecv does not wake up on packets with an interface mismatch: http://www.compholio.com/wine-kane/patches/2010-09-18/0005-ws2_32-Ensure-Asy... [6/6] server: Ensure Async ReadFile does not wake up on packets with an interface mismatch: http://www.compholio.com/wine-kane/patches/2010-09-18/0006-server-Ensure-Asy...
Erich Hoover ehoover@mines.edu