mirror of https://github.com/acidanthera/audk.git
NetworkPkg: Recycle the ICMP error message in PXE driver.
This patch updates PxeBcIcmpErrorDpcHandle() and PxeBcIcmp6ErrorDpcHandle() to recycle the ICMP packet after copy it to PXE mode data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
673abfb749
commit
3c06e6a9e2
|
@ -257,8 +257,7 @@ PxeBcIcmpErrorDpcHandle (
|
|||
//
|
||||
// The return status should be recognized as EFI_ICMP_ERROR.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&
|
||||
|
@ -268,16 +267,14 @@ PxeBcIcmpErrorDpcHandle (
|
|||
//
|
||||
// The source address of the received packet should be a valid unicast address.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
if (!EFI_IP4_EQUAL (&RxData->Header->DestinationAddress, &Mode->StationIp.v4)) {
|
||||
//
|
||||
// The destination address of the received packet should be equal to the host address.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -295,8 +292,7 @@ PxeBcIcmpErrorDpcHandle (
|
|||
//
|
||||
// The type of the receveid ICMP message should be ICMP_ERROR_MESSAGE.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -323,6 +319,9 @@ PxeBcIcmpErrorDpcHandle (
|
|||
IcmpError += CopiedLen;
|
||||
}
|
||||
|
||||
ON_RECYCLE:
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
|
||||
ON_EXIT:
|
||||
Private->IcmpToken.Status = EFI_NOT_READY;
|
||||
Ip4->Receive (Ip4, &Private->IcmpToken);
|
||||
|
@ -392,16 +391,14 @@ PxeBcIcmp6ErrorDpcHandle (
|
|||
//
|
||||
// The return status should be recognized as EFI_ICMP_ERROR.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
if (!NetIp6IsValidUnicast (&RxData->Header->SourceAddress)) {
|
||||
//
|
||||
// The source address of the received packet should be a valid unicast address.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
if (!NetIp6IsUnspecifiedAddr (&Mode->StationIp.v6) &&
|
||||
|
@ -409,8 +406,7 @@ PxeBcIcmp6ErrorDpcHandle (
|
|||
//
|
||||
// The destination address of the received packet should be equal to the host address.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -427,8 +423,7 @@ PxeBcIcmp6ErrorDpcHandle (
|
|||
//
|
||||
// The type of the receveid packet should be an ICMP6 error message.
|
||||
//
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
goto ON_EXIT;
|
||||
goto ON_RECYCLE;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -455,6 +450,9 @@ PxeBcIcmp6ErrorDpcHandle (
|
|||
Icmp6Error += CopiedLen;
|
||||
}
|
||||
|
||||
ON_RECYCLE:
|
||||
gBS->SignalEvent (RxData->RecycleSignal);
|
||||
|
||||
ON_EXIT:
|
||||
Private->Icmp6Token.Status = EFI_NOT_READY;
|
||||
Ip6->Receive (Ip6, &Private->Icmp6Token);
|
||||
|
|
Loading…
Reference in New Issue