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>
return;\r
}\r
\r
- if (EFI_ERROR (Status) || (RxData == NULL)) {\r
+ if (RxData == NULL) {\r
+ goto Resume;\r
+ }\r
+\r
+ if (Status != EFI_ICMP_ERROR) {\r
//\r
- // Only process the normal packets and the icmp error packets, if RxData is NULL\r
- // with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although\r
- // this should be a bug of the low layer (IP).\r
+ // The return status should be recognized as EFI_ICMP_ERROR.\r
//\r
- goto Resume;\r
+ goto CleanUp;\r
}\r
\r
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&\r
CopiedPointer += CopiedLen;\r
}\r
\r
- goto Resume;\r
-\r
CleanUp:\r
gBS->SignalEvent (RxData->RecycleSignal);\r
\r