]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Recycle the ICMP error message in PXE driver.
authorFu Siyuan <siyuan.fu@intel.com>
Thu, 21 Dec 2017 07:19:26 +0000 (15:19 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Fri, 22 Dec 2017 07:36:32 +0000 (15:36 +0800)
This patch updates PxeBcIcmpErrorDpcHandle() and PxeBcIcmp6ErrorDpcHandle() to
recycle the ICMP packet after copy it to PXE mode data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c

index 720287583e5ff12ba8e065fbf005f8ef8cf9b436..47bb7c5dbbbcf12816c01ef9b1f4e9ea012b2fe7 100644 (file)
@@ -257,8 +257,7 @@ PxeBcIcmpErrorDpcHandle (
     //\r
     // The return status should be recognized as EFI_ICMP_ERROR.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
 \r
   if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&\r
@@ -268,16 +267,14 @@ PxeBcIcmpErrorDpcHandle (
     //\r
     // The source address of the received packet should be a valid unicast address.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
 \r
   if (!EFI_IP4_EQUAL (&RxData->Header->DestinationAddress, &Mode->StationIp.v4)) {\r
     //\r
     // The destination address of the received packet should be equal to the host address.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
   \r
   //\r
@@ -295,8 +292,7 @@ PxeBcIcmpErrorDpcHandle (
     //\r
     // The type of the receveid ICMP message should be ICMP_ERROR_MESSAGE.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
 \r
   //\r
@@ -323,6 +319,9 @@ PxeBcIcmpErrorDpcHandle (
     IcmpError += CopiedLen;\r
   }\r
 \r
+ON_RECYCLE:\r
+  gBS->SignalEvent (RxData->RecycleSignal);\r
+\r
 ON_EXIT:\r
   Private->IcmpToken.Status = EFI_NOT_READY;\r
   Ip4->Receive (Ip4, &Private->IcmpToken);\r
@@ -392,16 +391,14 @@ PxeBcIcmp6ErrorDpcHandle (
     //\r
     // The return status should be recognized as EFI_ICMP_ERROR.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
 \r
   if (!NetIp6IsValidUnicast (&RxData->Header->SourceAddress)) {\r
     //\r
     // The source address of the received packet should be a valid unicast address.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
 \r
   if (!NetIp6IsUnspecifiedAddr (&Mode->StationIp.v6) &&\r
@@ -409,8 +406,7 @@ PxeBcIcmp6ErrorDpcHandle (
     //\r
     // The destination address of the received packet should be equal to the host address.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
 \r
   //\r
@@ -427,8 +423,7 @@ PxeBcIcmp6ErrorDpcHandle (
     //\r
     // The type of the receveid packet should be an ICMP6 error message.\r
     //\r
-    gBS->SignalEvent (RxData->RecycleSignal);\r
-    goto ON_EXIT;\r
+    goto ON_RECYCLE;\r
   }\r
 \r
   //\r
@@ -455,6 +450,9 @@ PxeBcIcmp6ErrorDpcHandle (
     Icmp6Error += CopiedLen;\r
   }\r
 \r
+ON_RECYCLE:\r
+  gBS->SignalEvent (RxData->RecycleSignal);\r
+  \r
 ON_EXIT:\r
   Private->Icmp6Token.Status = EFI_NOT_READY;\r
   Ip6->Receive (Ip6, &Private->Icmp6Token);\r