From c5487167df0fb0e444d82d2ac229369991b12ebe Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 22 Jun 2021 10:24:13 -0500 Subject: [PATCH] ws2_32: Explicitly forbid setting SO_ACCEPTCONN. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/ws2_32/socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 71537e6a2d8..a0f704eba20 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -3617,7 +3617,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, /* The options listed here don't need any special handling. Thanks to * the conversion happening above, options from there will fall through * to this, too.*/ - case WS_SO_ACCEPTCONN: case WS_SO_BROADCAST: case WS_SO_ERROR: case WS_SO_KEEPALIVE: @@ -3714,6 +3713,9 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, default: TRACE("Unknown SOL_SOCKET optname: 0x%08x\n", optname); + /* fall through */ + + case WS_SO_ACCEPTCONN: SetLastError(WSAENOPROTOOPT); return SOCKET_ERROR; }