[PATCH 1/2] ws2_32/socket: Do not change the socket address to INADDR_ANY

Erich E. Hoover erich.e.hoover at gmail.com
Sat Apr 6 13:16:17 CDT 2019


On Fri, Apr 5, 2019 at 9:27 PM Michel van Langen
<michelvanlangen at gmail.com> wrote:
> Changing the socket address causes some applications to attempt to bind
> the same port twice. These applications enumerate all adapters on the
> local machine and bind to their unique addresses so they can receive UDP
> broadcast messages on every connected network.
>
> By default, binding to 0.0.0.0:<port> will only bind to the primary
> adapter of the machine using Windows.

This won't work, it needs to bind to INADDR_ANY for broadcast packets
to work properly.  All of the applications that I have encountered
work just fine with this (they bind to the same port as many times as
you have local adapters).  Is the application you encountered not
using SO_REUSEADDR?

Best,
Erich



More information about the wine-devel mailing list