Cygwin: tcp: fix IPPROTO_TCP option handling
- Drop definitions from <cygwin/sockets.h> - Drop options only available on BSD - Fix value of TCP_MAXSEG. It was still defined as the BSD value while WinSock uses another value - Handle the fact that TCP_MAXSEG is a R/O value in WinSock Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#endif
|
||||
#include <w32api/ws2tcpip.h>
|
||||
#include <w32api/mswsock.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <unistd.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -1682,6 +1683,20 @@ fhandler_socket_inet::setsockopt (int level, int optname, const void *optval,
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
||||
case IPPROTO_TCP:
|
||||
switch (optname)
|
||||
{
|
||||
case TCP_MAXSEG:
|
||||
/* Winsock doesn't support setting TCP_MAXSEG, only requesting it
|
||||
via getsockopt. Make this a no-op. */
|
||||
ignore = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Call Winsock setsockopt (or not) */
|
||||
|
Reference in New Issue
Block a user