Commit 4c1a288f authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

server: Always update cached socket name after connect.

Fixes a regression introduced by 5c009c17. For IPV6 socket already bound with bind() with IPV6_V6ONLY set to 0 the address returned by getsockname() may change after it is connected to a IPV4 peer (e. g., from :: to ::ffff:192.0.2.128). The effect of blamed commit is that before that Unix getsockname() was called for each ws2_32 getsockname() and after the commit the socket name is cached at bind and connect. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9da1a505
...@@ -2340,7 +2340,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) ...@@ -2340,7 +2340,7 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
allow_fd_caching( sock->fd ); allow_fd_caching( sock->fd );
unix_len = sizeof(unix_addr); unix_len = sizeof(unix_addr);
if (!sock->bound && !getsockname( unix_fd, &unix_addr.addr, &unix_len )) if (!getsockname( unix_fd, &unix_addr.addr, &unix_len ))
sock->addr_len = sockaddr_from_unix( &unix_addr, &sock->addr.addr, sizeof(sock->addr) ); sock->addr_len = sockaddr_from_unix( &unix_addr, &sock->addr.addr, sizeof(sock->addr) );
sock->bound = 1; sock->bound = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment