summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2017-12-21 15:19:26 +0800
committerFu Siyuan <siyuan.fu@intel.com>2017-12-22 15:36:32 +0800
commit3c06e6a9e28c5c1057ecf3b097a76e77474266c7 (patch)
tree019a6cbe660731f84d372261dda89ee3b6f8e870 /NetworkPkg
parent673abfb7491b4abd73bb6a770cf8cd293fbbccb4 (diff)
downloadedk2-3c06e6a9e28c5c1057ecf3b097a76e77474266c7.tar.gz
edk2-3c06e6a9e28c5c1057ecf3b097a76e77474266c7.tar.bz2
edk2-3c06e6a9e28c5c1057ecf3b097a76e77474266c7.zip
NetworkPkg: Recycle the ICMP error message in PXE driver.
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>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
index 720287583e..47bb7c5dbb 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;
}
if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&
@@ -268,16 +267,14 @@ PxeBcIcmpErrorDpcHandle (
//
// The source address of the received packet should be a valid unicast address.
//
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
+ goto ON_RECYCLE;
}
if (!EFI_IP4_EQUAL (&RxData->Header->DestinationAddress, &Mode->StationIp.v4)) {
//
// The destination address of the received packet should be equal to the host address.
//
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
+ goto ON_RECYCLE;
}
//
@@ -295,8 +292,7 @@ PxeBcIcmpErrorDpcHandle (
//
// The type of the receveid ICMP message should be ICMP_ERROR_MESSAGE.
//
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
+ goto ON_RECYCLE;
}
//
@@ -323,6 +319,9 @@ PxeBcIcmpErrorDpcHandle (
IcmpError += CopiedLen;
}
+ON_RECYCLE:
+ gBS->SignalEvent (RxData->RecycleSignal);
+
ON_EXIT:
Private->IcmpToken.Status = EFI_NOT_READY;
Ip4->Receive (Ip4, &Private->IcmpToken);
@@ -392,16 +391,14 @@ PxeBcIcmp6ErrorDpcHandle (
//
// The return status should be recognized as EFI_ICMP_ERROR.
//
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
+ goto ON_RECYCLE;
}
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;
}
if (!NetIp6IsUnspecifiedAddr (&Mode->StationIp.v6) &&
@@ -409,8 +406,7 @@ PxeBcIcmp6ErrorDpcHandle (
//
// The destination address of the received packet should be equal to the host address.
//
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
+ goto ON_RECYCLE;
}
//
@@ -427,8 +423,7 @@ PxeBcIcmp6ErrorDpcHandle (
//
// The type of the receveid packet should be an ICMP6 error message.
//
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
+ goto ON_RECYCLE;
}
//
@@ -455,6 +450,9 @@ PxeBcIcmp6ErrorDpcHandle (
Icmp6Error += CopiedLen;
}
+ON_RECYCLE:
+ gBS->SignalEvent (RxData->RecycleSignal);
+
ON_EXIT:
Private->Icmp6Token.Status = EFI_NOT_READY;
Ip6->Receive (Ip6, &Private->Icmp6Token);