Bruno Jesus : ws2_32: UDP sockets can write data even when unbound.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 19 07:19:13 CDT 2015


Module: wine
Branch: master
Commit: 45677e173d6efb64e6ab29689df118f2b15628fd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=45677e173d6efb64e6ab29689df118f2b15628fd

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Thu Jun 18 11:03:10 2015 -0300

ws2_32: UDP sockets can write data even when unbound.

---

 dlls/ws2_32/socket.c     | 3 ++-
 dlls/ws2_32/tests/sock.c | 2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 63c965e..4fe3a0b 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4708,7 +4708,8 @@ static struct pollfd *fd_sets_to_poll( const WS_fd_set *readfds, const WS_fd_set
             fds[j].fd = get_sock_fd( writefds->fd_array[i], FILE_WRITE_DATA, NULL );
             if (fds[j].fd == -1) goto failed;
             fds[j].revents = 0;
-            if (is_fd_bound(fds[j].fd, NULL, NULL) == 1)
+            if (is_fd_bound(fds[j].fd, NULL, NULL) == 1 ||
+                _get_fd_type(fds[j].fd) == SOCK_DGRAM)
             {
                 fds[j].events = POLLOUT;
             }
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 7335faa..2d14496 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3877,9 +3877,7 @@ todo_wine
     FD_ZERO_ALL();
     FD_SET_ALL(fdWrite);
     ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout);
-todo_wine
     ok(ret == 1, "expected 1, got %d\n", ret);
-todo_wine
     ok(FD_ISSET(fdWrite, &writefds), "fdWrite socket is not in the set\n");
     closesocket(fdWrite);
 }




More information about the wine-cvs mailing list