From nobody Thu May 2 12:11:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513842393326811.8975745871846; Wed, 20 Dec 2017 23:46:33 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 316712219BCBB; Wed, 20 Dec 2017 23:41:43 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 39DAB2219BC80 for ; Wed, 20 Dec 2017 23:41:41 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2017 23:46:29 -0800 Received: from sfu5-mobl.ccr.corp.intel.com ([10.239.192.229]) by orsmga003.jf.intel.com with ESMTP; 20 Dec 2017 23:46:28 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,434,1508828400"; d="scan'208";a="14103079" From: Fu Siyuan To: edk2-devel@lists.01.org Date: Thu, 21 Dec 2017 15:46:25 +0800 Message-Id: <20171221074626.372-1-siyuan.fu@intel.com> X-Mailer: git-send-email 2.13.0.windows.1 Subject: [edk2] [Patch] NetworkPkg: Recycle the ICMP error message in PXE driver. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Wang Fan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch updates PxeBcIcmpErrorDpcHandle() and PxeBcIcmp6ErrorDpcHandle()= to recycle the ICMP packet after copy it to PXE mode data. Cc: Ye Ting Cc: Wu Jiaxin Cc: Wang Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Jiaxin Wu --- NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 36 +++++++++++++++---------------= ---- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c b/NetworkPkg/UefiPxeBcD= xe/PxeBcSupport.c index dfc79a067b..1e77929364 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c @@ -257,8 +257,7 @@ PxeBcIcmpErrorDpcHandle ( // // The return status should be recognized as EFI_ICMP_ERROR. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 if (EFI_IP4 (RxData->Header->SourceAddress) !=3D 0 && @@ -268,24 +267,21 @@ PxeBcIcmpErrorDpcHandle ( // // The source address of the received packet should be a valid unicast= address. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 if (!EFI_IP4_EQUAL (&RxData->Header->DestinationAddress, &Mode->StationI= p.v4)) { // // The destination address of the received packet should be equal to t= he host address. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 if (RxData->Header->Protocol !=3D EFI_IP_PROTO_ICMP) { // // The protocol value in the header of the receveid packet should be E= FI_IP_PROTO_ICMP. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 Type =3D *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer); @@ -298,8 +294,7 @@ PxeBcIcmpErrorDpcHandle ( // // The type of the receveid ICMP message should be ICMP_ERROR_MESSAGE. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 // @@ -326,6 +321,9 @@ PxeBcIcmpErrorDpcHandle ( IcmpError +=3D CopiedLen; } =20 +ON_RECYCLE: + gBS->SignalEvent (RxData->RecycleSignal); + ON_EXIT: Private->IcmpToken.Status =3D EFI_NOT_READY; Ip4->Receive (Ip4, &Private->IcmpToken); @@ -395,16 +393,14 @@ PxeBcIcmp6ErrorDpcHandle ( // // The return status should be recognized as EFI_ICMP_ERROR. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 if (!NetIp6IsValidUnicast (&RxData->Header->SourceAddress)) { // // The source address of the received packet should be a valid unicast= address. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 if (!NetIp6IsUnspecifiedAddr (&Mode->StationIp.v6) && @@ -412,16 +408,14 @@ PxeBcIcmp6ErrorDpcHandle ( // // The destination address of the received packet should be equal to t= he host address. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 if (RxData->Header->NextHeader !=3D IP6_ICMP) { // // The nextheader in the header of the receveid packet should be IP6_I= CMP. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 Type =3D *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer); @@ -433,8 +427,7 @@ PxeBcIcmp6ErrorDpcHandle ( // // The type of the receveid packet should be an ICMP6 error message. // - gBS->SignalEvent (RxData->RecycleSignal); - goto ON_EXIT; + goto ON_RECYCLE; } =20 // @@ -461,6 +454,9 @@ PxeBcIcmp6ErrorDpcHandle ( Icmp6Error +=3D CopiedLen; } =20 +ON_RECYCLE: + gBS->SignalEvent (RxData->RecycleSignal); + =20 ON_EXIT: Private->Icmp6Token.Status =3D EFI_NOT_READY; Ip6->Receive (Ip6, &Private->Icmp6Token); --=20 2.13.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel