From: Jiaxin Wu <jiaxin.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Siyuan Fu <siyuan.fu@intel.com>, Heyi Guo <heyi.guo@linaro.org>,
Ye Ting <ting.ye@intel.com>
Subject: [Patch] MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data.
Date: Tue, 12 Dec 2017 19:26:41 +0800 [thread overview]
Message-ID: <1513078001-5392-1-git-send-email-jiaxin.wu@intel.com> (raw)
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>
---
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
index 6d4f33f..4bfeaf3 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
@@ -164,17 +164,19 @@ IcmpErrorListenHandlerDpc (
// The reception is actively aborted by the consumer, directly return.
//
return;
}
- if (EFI_ERROR (Status) || (RxData == NULL)) {
+ if (RxData == NULL) {
+ goto Resume;
+ }
+
+ if (Status != EFI_ICMP_ERROR) {
//
- // 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).
+ // The return status should be recognized as EFI_ICMP_ERROR.
//
- goto Resume;
+ 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])) &&
@@ -214,12 +216,10 @@ IcmpErrorListenHandlerDpc (
);
}
CopiedPointer += CopiedLen;
}
- goto Resume;
-
CleanUp:
gBS->SignalEvent (RxData->RecycleSignal);
Resume:
Ip4->Receive (Ip4, &(Private->IcmpErrorRcvToken));
--
1.9.5.msysgit.1
next reply other threads:[~2017-12-12 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 11:26 Jiaxin Wu [this message]
2017-12-13 1:25 ` [Patch] MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data Fu, Siyuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1513078001-5392-1-git-send-email-jiaxin.wu@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox