server: Return STATUS_ADDRESS_ALREADY_ASSOCIATED from IOCTL_AFD_BIND if the socket is already bound.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-06-15 23:13:31 -05:00 committed by Alexandre Julliard
parent 10bfe80ad5
commit a997c3980f
2 changed files with 7 additions and 1 deletions

View File

@ -1407,7 +1407,7 @@ static void test_bind(void)
ret = NtDeviceIoControlFile((HANDLE)s, event, NULL, NULL, &io, IOCTL_AFD_BIND,
&params, sizeof(params), &addr, sizeof(addr));
todo_wine ok(ret == STATUS_ADDRESS_ALREADY_ASSOCIATED, "got %#x\n", ret);
ok(ret == STATUS_ADDRESS_ALREADY_ASSOCIATED, "got %#x\n", ret);
s2 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

View File

@ -2405,6 +2405,12 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return 0;
}
if (sock->bound)
{
set_error( STATUS_ADDRESS_ALREADY_ASSOCIATED );
return 0;
}
unix_len = sockaddr_to_unix( &params->addr, in_size - sizeof(int), &unix_addr );
if (!unix_len)
{