Author: cgutman
Date: Sat Oct 25 18:44:41 2008
New Revision: 36974
URL:
http://svn.reactos.org/svn/reactos?rev=36974&view=rev
Log:
- Merge aicom-network-fixes up to r36973
Modified:
trunk/reactos/drivers/network/afd/afd/main.c
trunk/reactos/drivers/network/tcpip/datalink/lan.c
trunk/reactos/lib/drivers/ip/network/neighbor.c
trunk/reactos/lib/drivers/ip/transport/tcp/accept.c
trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
Modified: trunk/reactos/drivers/network/afd/afd/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Sat Oct 25 18:44:41 2008
@@ -221,10 +221,6 @@
ExFreePool( FCB->LocalAddress );
if( FCB->RemoteAddress )
ExFreePool( FCB->RemoteAddress );
- if( FCB->ListenIrp.ConnectionReturnInfo )
- ExFreePool( FCB->ListenIrp.ConnectionReturnInfo );
- if( FCB->ListenIrp.ConnectionCallInfo )
- ExFreePool( FCB->ListenIrp.ConnectionCallInfo );
if( FCB->TdiDeviceName.Buffer )
ExFreePool(FCB->TdiDeviceName.Buffer);
Modified: trunk/reactos/drivers/network/tcpip/datalink/lan.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/data…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Sat Oct 25 18:44:41
2008
@@ -628,6 +628,11 @@
("Called( NdisPacket %x, Offset %d, Adapter %x )\n",
NdisPacket, Offset, Adapter));
+ if (Adapter->State != LAN_STATE_STARTED) {
+ ProtocolSendComplete(Context, NdisPacket, NDIS_STATUS_NOT_ACCEPTED);
+ return;
+ }
+
TI_DbgPrint(DEBUG_DATALINK,
("Adapter Address [%02x %02x %02x %02x %02x %02x]\n",
Adapter->HWAddress[0] & 0xff,
@@ -643,7 +648,6 @@
LanChainCompletion( Adapter, NdisPacket );
- if (Adapter->State == LAN_STATE_STARTED) {
switch (Adapter->Media) {
case NdisMedium802_3:
EHeader = (PETH_HEADER)Data;
@@ -713,9 +717,6 @@
* the situation with IRPs. */
if (NdisStatus != NDIS_STATUS_PENDING)
ProtocolSendComplete((NDIS_HANDLE)Context, NdisPacket, NdisStatus);
- } else {
- ProtocolSendComplete((NDIS_HANDLE)Context, NdisPacket, NDIS_STATUS_CLOSED);
- }
}
static NTSTATUS
Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Sat Oct 25 18:44:41 2008
@@ -28,6 +28,9 @@
VOID NBSendPackets( PNEIGHBOR_CACHE_ENTRY NCE ) {
PLIST_ENTRY PacketEntry;
PNEIGHBOR_PACKET Packet;
+
+ if(!(NCE->State & NUD_CONNECTED))
+ return;
/* Send any waiting packets */
PacketEntry = ExInterlockedRemoveHeadList(&NCE->PacketQueue,
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/accept.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] Sat Oct 25 18:44:41
2008
@@ -87,13 +87,13 @@
TI_DbgPrint(DEBUG_TCP,("AddressToBind - %x:%x\n", AddressToBind.sin_addr,
AddressToBind.sin_port));
- OskitTCPBind( Connection->SocketContext,
- Connection,
- &AddressToBind,
- sizeof(AddressToBind) );
+ Status = TCPTranslateError( OskitTCPBind( Connection->SocketContext,
+ Connection,
+ &AddressToBind,
+ sizeof(AddressToBind) ) );
- Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext,
- Backlog ) );
+ if (NT_SUCCESS(Status))
+ Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext, Backlog
) );
TcpipRecursiveMutexLeave( &TCPLock );
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Sat Oct 25 18:44:41
2008
@@ -577,21 +577,24 @@
AddressToConnect.sin_family = AF_INET;
AddressToBind = AddressToConnect;
- OskitTCPBind( Connection->SocketContext,
+ Status = TCPTranslateError
+ ( OskitTCPBind( Connection->SocketContext,
Connection,
&AddressToBind,
- sizeof(AddressToBind) );
-
- memcpy( &AddressToConnect.sin_addr,
- &RemoteAddress.Address.IPv4Address,
- sizeof(AddressToConnect.sin_addr) );
- AddressToConnect.sin_port = RemotePort;
-
- Status = TCPTranslateError
- ( OskitTCPConnect( Connection->SocketContext,
- Connection,
- &AddressToConnect,
- sizeof(AddressToConnect) ) );
+ sizeof(AddressToBind) ) );
+
+ if (NT_SUCCESS(Status)) {
+ memcpy( &AddressToConnect.sin_addr,
+ &RemoteAddress.Address.IPv4Address,
+ sizeof(AddressToConnect.sin_addr) );
+ AddressToConnect.sin_port = RemotePort;
+
+ Status = TCPTranslateError
+ ( OskitTCPConnect( Connection->SocketContext,
+ Connection,
+ &AddressToConnect,
+ sizeof(AddressToConnect) ) );
+ }
TcpipRecursiveMutexLeave( &TCPLock );