diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c index 6d4f33f0db..4bfeaf3d31 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c @@ -166,15 +166,17 @@ IcmpErrorListenHandlerDpc ( return; } - if (EFI_ERROR (Status) || (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). - // + if (RxData == NULL) { 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 && (NTOHL (Mode->SubnetMask.Addr[0]) != 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; } - goto Resume; - CleanUp: gBS->SignalEvent (RxData->RecycleSignal);