ws2_32: Implement automatic broadcast for UDP sockets on sendto()

Hans Leidekker hans at codeweavers.com
Tue Dec 22 05:58:49 CST 2015


Hi Bruno,
>+        if (wsa->addr->sa_family == WS_AF_INET)
>+        {
>+            /* When the target IPv4 address ends in 255 we must always send it as
>+             * a broadcast. Trying to send the packet without setting SO_BROADCAST
>+             * results in EACCES, to avoid that we will manually enable the flag
>+             * and send the packet, after that we will restore the disabled flag
>+             * behavior. This is the most common estimate as the broadcast address
>+             * should actually be calculated using the netmask for the interface. */

It should really be calculated using the netmask, sending a broadcast packet here
is wrong if the user is not in a /24 network.





More information about the wine-devel mailing list