[MSAFD]
authorThomas Faber <thomas.faber@reactos.org>
Mon, 9 Nov 2015 17:00:26 +0000 (17:00 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 9 Nov 2015 17:00:26 +0000 (17:00 +0000)
- SO_LINGER is not supported for datagram sockets. Patch by Peter Hater.
CORE-10440

svn path=/trunk/; revision=69856

reactos/dll/win32/msafd/misc/dllmain.c

index be1987d..78032d3 100644 (file)
@@ -2127,6 +2127,11 @@ WSPGetSockOpt(IN SOCKET Handle,
                     break;
 
                 case SO_LINGER:
+                    if (Socket->SharedData.SocketType == SOCK_DGRAM)
+                    {
+                        *lpErrno = WSAENOPROTOOPT;
+                        return SOCKET_ERROR;
+                    }
                     Buffer = &Socket->SharedData.LingerData;
                     BufferSize = sizeof(struct linger);
                     break;