Skip to content

Commit

Permalink
Get rid of unused LookaheadBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Mar 8, 2019
1 parent 1950d7f commit 6a79b71
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions packetWin7/npf/npf/Read.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ NPF_TapExForEachOpen(
PUCHAR TmpBuffer = NULL;
PUCHAR HeaderBuffer;
UINT HeaderBufferSize;
PUCHAR LookaheadBuffer;
UINT LookaheadBufferSize;
UINT PacketSize;
ULONG TotalLength;
Expand Down Expand Up @@ -1038,7 +1037,6 @@ NPF_TapExForEachOpen(

HeaderBuffer = pDataLinkBuffer;
HeaderBufferSize = DataLinkHeaderSize;
LookaheadBuffer = pDataLinkBuffer + HeaderBufferSize;
LookaheadBufferSize = BufferLength - HeaderBufferSize;
PacketSize = LookaheadBufferSize;

Expand Down Expand Up @@ -1259,27 +1257,6 @@ NPF_TapExForEachOpen(
}
#endif

//
//we can consider the buffer contiguous, either because we use only the data
//present in the HeaderBuffer, or because HeaderBuffer and LookaheadBuffer are contiguous
// ;-))))))
//
// if (Open->Size - LocalData->P < iFres)
// {
// //the packet will be fragmented in the buffer (aka, it will skip the buffer boundary)
// //two copies!!
// ToCopy = Open->Size - LocalData->P;
// NdisMoveMappedMemory(LocalData->Buffer + LocalData->P, pHeaderBuffer, ToCopy);
// NdisMoveMappedMemory(LocalData->Buffer + 0, (PUCHAR)pHeaderBuffer + ToCopy, iFres - ToCopy);
// LocalData->P = iFres - ToCopy;
// }
// else
// {
// //the packet does not need to be fragmented in the buffer (aka, it doesn't skip the buffer boundary)
// // ;-)))))) only ONE copy
// NdisMoveMappedMemory(LocalData->Buffer + LocalData->P, pHeaderBuffer, iFres);
// LocalData->P += iFres;
// }

// Disable the IEEE802.1Q VLAN feature for now.
// if (withVlanTag)
Expand Down

0 comments on commit 6a79b71

Please sign in to comment.