From: "Fu, Siyuan" <siyuan.fu@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Heyi Guo <heyi.guo@linaro.org>, "Ye, Ting" <ting.ye@intel.com>
Subject: Re: [Patch] MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data.
Date: Wed, 13 Dec 2017 01:25:09 +0000 [thread overview]
Message-ID: <B1FF2E9001CE9041BD10B825821D5BC58B3F3F55@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1513078001-5392-1-git-send-email-jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Tuesday, December 12, 2017 7:27 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <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.
>
> 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
prev parent reply other threads:[~2017-12-13 1:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 11:26 [Patch] MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data Jiaxin Wu
2017-12-13 1:25 ` Fu, Siyuan [this message]
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=B1FF2E9001CE9041BD10B825821D5BC58B3F3F55@SHSMSX103.ccr.corp.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