[ros-diffs] [cgutman] 36962: - Fail earlier when we try to send on a non-connected adapter - This commit dedicated to blight_

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sat Oct 25 20:11:58 CEST 2008


Author: cgutman
Date: Sat Oct 25 13:11:57 2008
New Revision: 36962

URL: http://svn.reactos.org/svn/reactos?rev=36962&view=rev
Log:
 - Fail earlier when we try to send on a non-connected adapter
 - This commit dedicated to blight_

Modified:
    branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c

Modified: branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c?rev=36962&r1=36961&r2=36962&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Sat Oct 25 13:11:57 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



More information about the Ros-diffs mailing list