ws2_32: warn the user if broadcasts are failing because of a missing route to 255.255.255.255

Damjan Jovanovic damjan.jov at gmail.com
Mon Feb 8 14:07:50 CST 2010


Changelog:
* ws2_32: warn the user if broadcasts are failing because of a missing
route to 255.255.255.255

Damjan Jovanovic
-------------- next part --------------
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 9a65cb0..ac55e50 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1387,6 +1387,7 @@ static int WS2_send( int fd, struct ws2_async *wsa )
 {
     struct msghdr hdr;
     union generic_unix_sockaddr unix_addr;
+    int ret;
 
     hdr.msg_name = NULL;
     hdr.msg_namelen = 0;
@@ -1430,7 +1431,13 @@ static int WS2_send( int fd, struct ws2_async *wsa )
     hdr.msg_flags = 0;
 #endif
 
-    return sendmsg(fd, &hdr, wsa->flags);
+    ret = sendmsg(fd, &hdr, wsa->flags);
+    if (ret < 0 && errno == ENETUNREACH && wsa->addr && wsa->addr->sa_family == AF_INET &&
+        ((struct WS_sockaddr_in*)wsa->addr)->sin_addr.WS_s_addr == 0xFFFFFFFF)
+    {
+        FIXME("broadcast failed, you need to add a route to 255.255.255.255\n");
+    }
+    return ret;
 }
 
 /***********************************************************************


More information about the wine-patches mailing list