From 0f86ec149717098182279b01c9c2c88d617f784c Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 10 Oct 2004 22:38:22 +0000 Subject: [PATCH] Don't use NdisTransferData if the whole packet is contained in the header+lookup buffer. svn path=/trunk/; revision=11266 --- reactos/drivers/net/tcpip/datalink/lan.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/reactos/drivers/net/tcpip/datalink/lan.c b/reactos/drivers/net/tcpip/datalink/lan.c index 5c02f25c837..c6a7659aee8 100644 --- a/reactos/drivers/net/tcpip/datalink/lan.c +++ b/reactos/drivers/net/tcpip/datalink/lan.c @@ -371,19 +371,17 @@ NDIS_STATUS STDCALL ProtocolReceive( IPPacket.NdisPacket = NdisPacket; IPPacket.Position = 0; -#if 0 - if (LookaheadBufferSize < PacketSize) { -#endif - TI_DbgPrint(DEBUG_DATALINK, ("pretransfer LookaheadBufferSize %d packsize %d\n",LookaheadBufferSize,PacketSize)); + if ((LookaheadBufferSize + HeaderBufferSize) < PacketSize) + { + TI_DbgPrint(DEBUG_DATALINK, ("pretransfer LookaheadBufferSize %d packsize %d\n",LookaheadBufferSize,PacketSize)); /* Get the data */ - NdisTransferData(&NdisStatus, - Adapter->NdisHandle, - MacReceiveContext, - 0, - PacketSize + HeaderBufferSize, - NdisPacket, - &BytesTransferred); -#if 0 + NdisTransferData(&NdisStatus, + Adapter->NdisHandle, + MacReceiveContext, + 0, + PacketSize + HeaderBufferSize, + NdisPacket, + &BytesTransferred); } else { TI_DbgPrint(DEBUG_DATALINK, ("copy\n")); NdisStatus = NDIS_STATUS_SUCCESS; @@ -394,7 +392,6 @@ NDIS_STATUS STDCALL ProtocolReceive( RtlCopyMemory(BufferData + HeaderBufferSize, LookaheadBuffer, LookaheadBufferSize); } -#endif TI_DbgPrint(DEBUG_DATALINK, ("Calling complete\n")); /* Release the packet descriptor */