mirror of
https://github.com/reactos/reactos.git
synced 2025-07-29 09:41:48 +00:00
- Copy correct data to our lookahead buffer. It was previously missing the media header which messed up the lookahead buffer size passed to ProtocolReceive
- Fix the check for loopback indication. It was previously checking whether the source and destination packets were the same which makes no sense at all - Correct the offset and length passed to NdisCopyFromPacketToPacket. The caller's values of these don't include the header size but the packet does - Fixes a crash when running "ping 10.0.2.15 -l 1800" on vbox with NAT svn path=/trunk/; revision=43635
This commit is contained in:
parent
e31be82be3
commit
5635553281
1 changed files with 11 additions and 4 deletions
|
@ -279,7 +279,8 @@ ProIndicatePacket(
|
|||
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
|
||||
KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
|
||||
{
|
||||
BufferedLength = CopyPacketToBuffer(LookaheadBuffer, Packet, 0, Adapter->NdisMiniportBlock.CurrentLookahead);
|
||||
BufferedLength = CopyPacketToBuffer(LookaheadBuffer, Packet, 0, Adapter->NdisMiniportBlock.CurrentLookahead +
|
||||
Adapter->MediumHeaderSize);
|
||||
Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()] = Packet;
|
||||
}
|
||||
KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
|
||||
|
@ -298,6 +299,12 @@ ProIndicatePacket(
|
|||
|
||||
ExFreePool(LookaheadBuffer);
|
||||
|
||||
KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
|
||||
{
|
||||
Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()] = NULL;
|
||||
}
|
||||
KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
|
||||
|
||||
return NDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -649,12 +656,12 @@ ProTransferData(
|
|||
/* FIXME: Interrupts must be disabled for adapter */
|
||||
/* XXX sd - why is that true? */
|
||||
|
||||
if (Packet == Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()]) {
|
||||
if (Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()]) {
|
||||
NDIS_DbgPrint(MAX_TRACE, ("LoopPacket\n"));
|
||||
/* NDIS is responsible for looping this packet */
|
||||
NdisCopyFromPacketToPacket(Packet,
|
||||
ByteOffset,
|
||||
BytesToTransfer,
|
||||
ByteOffset + Adapter->MediumHeaderSize,
|
||||
BytesToTransfer + Adapter->MediumHeaderSize,
|
||||
Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()],
|
||||
0,
|
||||
BytesTransferred);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue