Module: wine Branch: master Commit: ddc6c3fb23ae9a6ad584b596e8c5a7ff8ef1b4c8 URL: https://gitlab.winehq.org/wine/wine/-/commit/ddc6c3fb23ae9a6ad584b596e8c5a7f...
Author: Zebediah Figura zfigura@codeweavers.com Date: Mon Dec 12 17:08:10 2022 -0600
server: Inherit address reuse flags in accept_socket().
---
dlls/ws2_32/tests/sock.c | 2 +- server/sock.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 32c2172f0db..d8500144bd0 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -4828,7 +4828,7 @@ static void test_accept_inheritance(void) len = sizeof(value); ret = getsockopt(server, int_tests[i].optname, int_tests[i].optval, (char *)&value, &len); ok(!ret, "test %u: got error %u\n", i, WSAGetLastError()); - todo_wine_if (i == 0 || (i >= 3 && i <= 6)) + todo_wine_if (i >= 3 && i <= 6) ok(value == int_tests[i].value, "test %u: got value %#x\n", i, value); }
diff --git a/server/sock.c b/server/sock.c index c130821b7f4..8fe6086b8f6 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1988,16 +1988,19 @@ static struct sock *accept_socket( struct sock *sock ) }
/* newly created socket gets the same properties of the listening socket */ - acceptsock->state = SOCK_CONNECTED; - acceptsock->bound = 1; - acceptsock->nonblocking = sock->nonblocking; - acceptsock->mask = sock->mask; - acceptsock->proto = sock->proto; - acceptsock->type = sock->type; - acceptsock->family = sock->family; - acceptsock->window = sock->window; - acceptsock->message = sock->message; - acceptsock->connect_time = current_time; + acceptsock->state = SOCK_CONNECTED; + acceptsock->bound = 1; + acceptsock->nonblocking = sock->nonblocking; + acceptsock->mask = sock->mask; + acceptsock->proto = sock->proto; + acceptsock->type = sock->type; + acceptsock->family = sock->family; + acceptsock->window = sock->window; + acceptsock->message = sock->message; + acceptsock->reuseaddr = sock->reuseaddr; + acceptsock->exclusiveaddruse = sock->exclusiveaddruse; + acceptsock->connect_time = current_time; + if (sock->event) acceptsock->event = (struct event *)grab_object( sock->event ); if (!(acceptsock->fd = create_anonymous_fd( &sock_fd_ops, acceptfd, &acceptsock->obj, get_fd_options( sock->fd ) )))