http://bugs.winehq.org/show_bug.cgi?id=33008
--- Comment #23 from Erich Hoover erich.e.hoover@gmail.com --- (In reply to facoptere from comment #22)
The application works, but not properly since 0.0.0.0 is bound ;) Consequence of which I can't start 2 UDP servers on the same machine...
You should be able to bind as many servers as you want to 0.0.0.0, when Wine activates this codepath it turns on SO_REUSEADDR on the socket so that other binds are not prohibited. What exactly happens when you try to start another UDP server?
If you know some sysctl options, assuming it's a Linux "feature", that tell Linux kernel to bind the IP address specified instead of the whole interfaces, please give them. I can't find them. If you know some Wine options that tell to respect arguments given in bind(), I would like to know them either.
At the moment you have to edit the Wine source to disable the option due to a problem with glibc not properly updating a header. If you edit dlls/ws2_32/socket.c line 166 by adding "#undef IP_UNICAST_IF" then it will go back to the old behavior.
The application does not process any broadcast packets, and if it does I would have written 0.0.0.0 in the startup parameters since it seems to be a Windows prerequisite.
Unfortunately we don't know at bind-time whether the application needs broadcast packets, so this option is enabled on all UDP sockets that are bound to a specific interface.
According to me, it's a bug that can leads to some security issue, since a server can be accessed from some interfaces it does not meant to be.
Wine sets the kernel option IP_UNICAST_IF to ensure that outbound packets go out the requested interface and it also configures a Linux Packet Filter to only accept packets on the interface you requested. Unless you are doing something really screwy with your routing table then the application is only going to see packets from the interface that was specified (this included broadcast packets, broadcast packets that come in on the wrong interface will be dropped).