This fixes a `todo_wine` in ws2_32's socket tests.
-- v4: server: Ignore EADDRINUSE from listen() unless the provided socket is wildcarded.
From: Ally Sommers dropbear.sh@gmail.com
--- dlls/ws2_32/tests/sock.c | 2 +- server/sock.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index e6ab5065cfe..4bf705ecf96 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2241,7 +2241,7 @@ static void test_reuseaddr(void) rc = listen(s1, 1); ok(!rc, "got error %d.\n", WSAGetLastError()); rc = listen(s2, 1); - todo_wine ok(!rc, "got error %d.\n", WSAGetLastError()); + ok(!rc, "got error %d.\n", WSAGetLastError()); rc = connect(s3, tests[i].addr_loopback, tests[i].addrlen); ok(!rc, "got error %d.\n", WSAGetLastError());
diff --git a/server/sock.c b/server/sock.c index 2aae9aefbf0..7f9065237d8 100644 --- a/server/sock.c +++ b/server/sock.c @@ -2525,6 +2525,21 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
if (listen( unix_fd, params->backlog ) < 0) { + if (errno == EADDRINUSE) + switch (sock->family) + { + case WS_AF_INET: + if (sock->addr.in.sin_addr.WS_s_addr != htonl( INADDR_ANY )) + return; + case WS_AF_INET6: + { + union unix_sockaddr unix_addr; + socklen_t len = sockaddr_to_unix(&sock->addr.addr, sizeof(struct WS_sockaddr_in6), &unix_addr); + if (len && !IN6_IS_ADDR_UNSPECIFIED(&unix_addr.in6.sin6_addr)) + return; + } + } + set_error( sock_get_ntstatus( errno ) ); return; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=135063
Your paranoid android.
=== w1064_adm (64 bit report) ===
ws2_32: sock.c:12836: Test failed: wait timed out sock.c:12700: Test failed: got size 5 sock.c:12701: Test failed: got "datad" sock.c:12700: Test failed: got size 3 sock.c:12701: Test failed: got "ata"