Commit 6361a20c authored by Gabriel Brand's avatar Gabriel Brand Committed by Alexandre Julliard

server: Return failure in bind if the address is not found.

parent b7f06a4a
......@@ -12528,9 +12528,7 @@ static void test_bind(void)
WSASetLastError(0xdeadbeef);
ret = bind(s, (const struct sockaddr *)&invalid_addr, sizeof(invalid_addr));
todo_wine
ok(ret == -1, "expected failure\n");
todo_wine
ok(WSAGetLastError() == WSAEADDRNOTAVAIL, "got error %u\n", WSAGetLastError());
WSASetLastError(0xdeadbeef);
......
......@@ -2231,7 +2231,7 @@ static int bind_to_interface( struct sock *sock, const struct sockaddr_in *addr
in_addr_t bind_addr = addr->sin_addr.s_addr;
struct ifaddrs *ifaddrs, *ifaddr;
int fd = get_unix_fd( sock->fd );
int err = 0;
int err = -1;
if (bind_addr == htonl( INADDR_ANY ) || bind_addr == htonl( INADDR_LOOPBACK ))
return 0;
......
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