From f1065f12f0e36ce6d4dd88196c09bdc65e9c696b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Wed, 8 Oct 2014 21:16:00 +0000 Subject: [PATCH] Revert r64621. It breaks internet connections. svn path=/trunk/; revision=64628 --- reactos/dll/win32/wshtcpip/wshtcpip.c | 50 +++++++------------- reactos/drivers/network/tcpip/CMakeLists.txt | 1 - reactos/drivers/network/tcpip/include/info.h | 5 -- reactos/drivers/network/tcpip/include/tcp.h | 2 - reactos/drivers/network/tcpip/tcpip/cinfo.c | 32 ------------- reactos/drivers/network/tcpip/tcpip/info.c | 23 ++------- reactos/include/psdk/tcpioctl.h | 3 -- reactos/lib/drivers/ip/transport/tcp/tcp.c | 12 ----- reactos/lib/drivers/lwip/src/include/rosip.h | 3 +- reactos/lib/drivers/lwip/src/rostcp.c | 11 ----- 10 files changed, 24 insertions(+), 118 deletions(-) delete mode 100644 reactos/drivers/network/tcpip/tcpip/cinfo.c diff --git a/reactos/dll/win32/wshtcpip/wshtcpip.c b/reactos/dll/win32/wshtcpip/wshtcpip.c index f568f0903f7..546dec171d1 100644 --- a/reactos/dll/win32/wshtcpip/wshtcpip.c +++ b/reactos/dll/win32/wshtcpip/wshtcpip.c @@ -156,18 +156,12 @@ WSHGetSockaddrType( return NO_ERROR; } -static -void -GetTdiTypeId( - _In_ INT Level, - _In_ INT OptionName, - _Out_ PULONG TdiType, - _Out_ PULONG TdiId) +UINT +GetAddressOption(INT Level, INT OptionName) { switch (Level) { case SOL_SOCKET: - *TdiType = INFO_TYPE_ADDRESS_OBJECT; switch (OptionName) { case SO_KEEPALIVE: @@ -180,26 +174,21 @@ GetTdiTypeId( break; case IPPROTO_IP: - *TdiType = INFO_TYPE_ADDRESS_OBJECT; switch (OptionName) { case IP_TTL: - *TdiId = AO_OPTION_TTL; - return; + return AO_OPTION_TTL; case IP_DONTFRAGMENT: - *TdiId = AO_OPTION_IP_DONTFRAGMENT; - return; + return AO_OPTION_IP_DONTFRAGMENT; #if 0 case IP_RECEIVE_BROADCAST: - *TdiId = AO_OPTION_BROADCAST; - return; + return AO_OPTION_BROADCAST; #endif case IP_HDRINCL: - *TdiId = AO_OPTION_IP_HDRINCL; - return; + return AO_OPTION_IP_HDRINCL; default: break; @@ -209,10 +198,10 @@ GetTdiTypeId( case IPPROTO_TCP: switch (OptionName) { - *TdiType = INFO_TYPE_CONNECTION; case TCP_NODELAY: - *TdiId = TCP_SOCKET_NODELAY; - return; + /* FIXME: Return proper option */ + ASSERT(FALSE); + break; default: break; } @@ -222,8 +211,7 @@ GetTdiTypeId( } DPRINT1("Unknown level/option name: %d %d\n", Level, OptionName); - *TdiType = 0; - *TdiId = 0; + return 0; } INT @@ -654,7 +642,7 @@ WSHSetSocketInformation( IN INT OptionLength) { PSOCKET_CONTEXT Context = HelperDllSocketContext; - ULONG TdiType, TdiId; + UINT RealOptionName; INT Status; PTCP_REQUEST_SET_INFORMATION_EX Info; PQUEUED_REQUEST Queued, NextQueued; @@ -709,11 +697,9 @@ WSHSetSocketInformation( switch (OptionName) { case TCP_NODELAY: - if (OptionLength < sizeof(CHAR)) - { - return WSAEFAULT; - } - break; + /* FIXME -- Send this to TCPIP */ + DPRINT1("Set: TCP_NODELAY not yet supported\n"); + return 0; default: /* Invalid option */ @@ -728,8 +714,8 @@ WSHSetSocketInformation( } /* If we get here, GetAddressOption must return something valid */ - GetTdiTypeId(Level, OptionName, &TdiId, &TdiType); - ASSERT((TdiId != 0) && (TdiType != 0)); + RealOptionName = GetAddressOption(Level, OptionName); + ASSERT(RealOptionName != 0); Info = HeapAlloc(GetProcessHeap(), 0, sizeof(*Info) + OptionLength); if (!Info) @@ -738,8 +724,8 @@ WSHSetSocketInformation( Info->ID.toi_entity.tei_entity = Context->AddrFileEntityType; Info->ID.toi_entity.tei_instance = Context->AddrFileInstance; Info->ID.toi_class = INFO_CLASS_PROTOCOL; - Info->ID.toi_type = TdiType; - Info->ID.toi_id = TdiId; + Info->ID.toi_type = INFO_TYPE_ADDRESS_OBJECT; + Info->ID.toi_id = RealOptionName; Info->BufferSize = OptionLength; memcpy(Info->Buffer, OptionValue, OptionLength); diff --git a/reactos/drivers/network/tcpip/CMakeLists.txt b/reactos/drivers/network/tcpip/CMakeLists.txt index 5a8230a8e9c..317f11241d3 100644 --- a/reactos/drivers/network/tcpip/CMakeLists.txt +++ b/reactos/drivers/network/tcpip/CMakeLists.txt @@ -14,7 +14,6 @@ list(APPEND SOURCE datalink/lan.c tcpip/ainfo.c tcpip/buffer.c - tcpip/cinfo.c tcpip/dispatch.c tcpip/fileobjs.c tcpip/iinfo.c diff --git a/reactos/drivers/network/tcpip/include/info.h b/reactos/drivers/network/tcpip/include/info.h index 68012042630..a05b0b2944e 100644 --- a/reactos/drivers/network/tcpip/include/info.h +++ b/reactos/drivers/network/tcpip/include/info.h @@ -183,11 +183,6 @@ TDI_STATUS GetAddressFileInfo(TDIObjectID *ID, PVOID Buffer, PUINT BufferSize); -TDI_STATUS SetConnectionInfo(TDIObjectID *ID, - PCONNECTION_ENDPOINT Connection, - PVOID Buffer, - UINT BufferSize); - /* Insert and remove entities */ VOID InsertTDIInterfaceEntity( PIP_INTERFACE Interface ); diff --git a/reactos/drivers/network/tcpip/include/tcp.h b/reactos/drivers/network/tcpip/include/tcp.h index 20147c77d79..c31293c0e0b 100644 --- a/reactos/drivers/network/tcpip/include/tcp.h +++ b/reactos/drivers/network/tcpip/include/tcp.h @@ -186,8 +186,6 @@ NTSTATUS TCPShutdown( BOOLEAN TCPRemoveIRP( PCONNECTION_ENDPOINT Connection, PIRP Irp ); -NTSTATUS TCPSetNoDelay(PCONNECTION_ENDPOINT Connection, BOOLEAN Set); - VOID TCPUpdateInterfaceLinkStatus(PIP_INTERFACE IF); diff --git a/reactos/drivers/network/tcpip/tcpip/cinfo.c b/reactos/drivers/network/tcpip/tcpip/cinfo.c deleted file mode 100644 index 184532cc5ed..00000000000 --- a/reactos/drivers/network/tcpip/tcpip/cinfo.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS TCP/IP protocol driver - * FILE: tcpip/cinfo.c - * PURPOSE: Per-socket connection information. - * PROGRAMMER: Jérôme Gardou - */ - -#include "precomp.h" - -TDI_STATUS SetConnectionInfo(TDIObjectID *ID, - PCONNECTION_ENDPOINT Connection, - PVOID Buffer, - UINT BufferSize) -{ - ASSERT(ID->toi_type == INFO_TYPE_CONNECTION); - switch (ID->toi_id) - { - case TCP_SOCKET_NODELAY: - { - BOOLEAN Set; - if (BufferSize < sizeof(BOOLEAN)) - return TDI_INVALID_PARAMETER; - Set = *(BOOLEAN*)Buffer; - return TCPSetNoDelay(Connection, Set); - } - default: - DbgPrint("TCPIP: Unknown connection info ID: %u.\n", ID->toi_id); - } - - return TDI_INVALID_PARAMETER; -} diff --git a/reactos/drivers/network/tcpip/tcpip/info.c b/reactos/drivers/network/tcpip/tcpip/info.c index 889ca21d0c6..ac4174f0285 100644 --- a/reactos/drivers/network/tcpip/tcpip/info.c +++ b/reactos/drivers/network/tcpip/tcpip/info.c @@ -326,25 +326,12 @@ TDI_STATUS InfoTdiSetInformationEx switch (ID->toi_class) { case INFO_CLASS_PROTOCOL: - switch (ID->toi_type) + if (ID->toi_type == INFO_TYPE_ADDRESS_OBJECT) { - case INFO_TYPE_ADDRESS_OBJECT: - { - if ((EntityListContext = GetContext(ID->toi_entity))) - return SetAddressFileInfo(ID, EntityListContext, Buffer, BufferSize); - else - return TDI_INVALID_PARAMETER; - } - case INFO_TYPE_CONNECTION: - { - PADDRESS_FILE AddressFile = GetContext(ID->toi_entity); - if (AddressFile == NULL) - return TDI_INVALID_PARAMETER; - return SetConnectionInfo(ID, AddressFile->Connection, Buffer, BufferSize); - } - default: - DbgPrint("TCPIP: IOCTL_TCP_SET_INFORMATION_EX - Unrecognized information type for INFO_CLASS_PROTOCOL: 0x%#x.\n", ID->toi_type); - return TDI_INVALID_PARAMETER; + if ((EntityListContext = GetContext(ID->toi_entity))) + return SetAddressFileInfo(ID, EntityListContext, Buffer, BufferSize); + else + return TDI_INVALID_PARAMETER; } switch (ID->toi_id) diff --git a/reactos/include/psdk/tcpioctl.h b/reactos/include/psdk/tcpioctl.h index 6817528ec42..28d0f351773 100644 --- a/reactos/include/psdk/tcpioctl.h +++ b/reactos/include/psdk/tcpioctl.h @@ -90,9 +90,6 @@ #define AO_OPTION_UNBIND 37 #define AO_OPTION_PROTECT 38 -/* TCP connection options */ -#define TCP_SOCKET_NODELAY 1 - typedef struct IFEntry { ULONG if_index; diff --git a/reactos/lib/drivers/ip/transport/tcp/tcp.c b/reactos/lib/drivers/ip/transport/tcp/tcp.c index 5d013be3531..d29e93c2f0e 100644 --- a/reactos/lib/drivers/ip/transport/tcp/tcp.c +++ b/reactos/lib/drivers/ip/transport/tcp/tcp.c @@ -674,16 +674,4 @@ BOOLEAN TCPRemoveIRP( PCONNECTION_ENDPOINT Endpoint, PIRP Irp ) return Found; } -NTSTATUS -TCPSetNoDelay( - PCONNECTION_ENDPOINT Connection, - BOOLEAN Set) -{ - if (Connection->SocketContext == NULL) - return STATUS_UNSUCCESSFUL; - LibTCPSetNoDelay(Connection->SocketContext, Set); - return STATUS_SUCCESS; -} - - /* EOF */ diff --git a/reactos/lib/drivers/lwip/src/include/rosip.h b/reactos/lib/drivers/lwip/src/include/rosip.h index f8f5592ad5d..9fa2b16cc3a 100755 --- a/reactos/lib/drivers/lwip/src/include/rosip.h +++ b/reactos/lib/drivers/lwip/src/include/rosip.h @@ -107,11 +107,10 @@ err_t LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const i err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port); err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port); void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg); -void LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set); /* IP functions */ void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size); void LibIPInitialize(void); void LibIPShutdown(void); -#endif +#endif \ No newline at end of file diff --git a/reactos/lib/drivers/lwip/src/rostcp.c b/reactos/lib/drivers/lwip/src/rostcp.c index ea06d75a7f4..44a865ab3ca 100755 --- a/reactos/lib/drivers/lwip/src/rostcp.c +++ b/reactos/lib/drivers/lwip/src/rostcp.c @@ -829,14 +829,3 @@ LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr * const ipaddr, u16_t * const por return ERR_OK; } - -void -LibTCPSetNoDelay( - PTCP_PCB pcb, - BOOLEAN Set) -{ - if (Set) - pcb->flags |= TF_NODELAY; - else - pcb->flags &= ~TF_NODELAY; -} -- 2.17.1