mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data.
This patch is to discard the normal ICMP packets and recycle the received ICMP data to avoid the memory leak. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Heyi Guo <heyi.guo@linaro.org> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Tested-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
parent
19bf8314dc
commit
3fe97d9459
@ -166,15 +166,17 @@ IcmpErrorListenHandlerDpc (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EFI_ERROR (Status) || (RxData == NULL)) {
|
if (RxData == NULL) {
|
||||||
//
|
|
||||||
// Only process the normal packets and the icmp error packets, if RxData is NULL
|
|
||||||
// with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although
|
|
||||||
// this should be a bug of the low layer (IP).
|
|
||||||
//
|
|
||||||
goto Resume;
|
goto Resume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Status != EFI_ICMP_ERROR) {
|
||||||
|
//
|
||||||
|
// The return status should be recognized as EFI_ICMP_ERROR.
|
||||||
|
//
|
||||||
|
goto CleanUp;
|
||||||
|
}
|
||||||
|
|
||||||
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&
|
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&
|
||||||
(NTOHL (Mode->SubnetMask.Addr[0]) != 0) &&
|
(NTOHL (Mode->SubnetMask.Addr[0]) != 0) &&
|
||||||
IP4_NET_EQUAL (NTOHL(Mode->StationIp.Addr[0]), EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0])) &&
|
IP4_NET_EQUAL (NTOHL(Mode->StationIp.Addr[0]), EFI_NTOHL (RxData->Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0])) &&
|
||||||
@ -216,8 +218,6 @@ IcmpErrorListenHandlerDpc (
|
|||||||
CopiedPointer += CopiedLen;
|
CopiedPointer += CopiedLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
goto Resume;
|
|
||||||
|
|
||||||
CleanUp:
|
CleanUp:
|
||||||
gBS->SignalEvent (RxData->RecycleSignal);
|
gBS->SignalEvent (RxData->RecycleSignal);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user