Attached is a patch I have been working to fix Bug #7929 (C&C 3 network does not work). This patch replaces interface-specific bind requests (on UDP datagrams only) with a global bind and stores the interface index. The patch then uses IP_PKTINFO to set the outgoing interface and filter incoming packets based on interface (checking against the stored interface index from the initial bind). Additionally, the patch peeks at packets in "select" and asynchronous I/O operations to ensure that spurious wakeups do not occur when a packet comes in from the wrong interface.
I intend to split the patch into the following pieces: 1) UDP broadcast tests (used for making sure everything works) 2) The "bare essentials" (storing and retrieving the interface index, and setting/filtering the interface) 3) Ensure "select" does not wake up on packets with an interface mismatch 4) Ensure Async WSARecv does not wake up on packets with an interface mismatch 5) Ensure Async ReadFile does not wake up on packets with an interface mismatch
I would greatly appreciate any comments people have on this patch. Thanks so much!
Erich Hoover ehoover@mines.edu