diff options
author | Fu Siyuan <siyuan.fu@intel.com> | 2017-12-21 15:31:22 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2017-12-22 15:34:19 +0800 |
commit | 673abfb7491b4abd73bb6a770cf8cd293fbbccb4 (patch) | |
tree | 89dc74bd3322ae62f6957505008fdff6ab0ede00 /NetworkPkg/UefiPxeBcDxe | |
parent | c7285227e75dfc92843e0814b59ce38ed2e80764 (diff) | |
download | edk2-673abfb7491b4abd73bb6a770cf8cd293fbbccb4.tar.gz edk2-673abfb7491b4abd73bb6a770cf8cd293fbbccb4.tar.bz2 edk2-673abfb7491b4abd73bb6a770cf8cd293fbbccb4.zip |
NetworkPkg: Remove redundant check in PXE driver.
The IP protocol has been configured to only receive ICMP packet in PXE driver.
So this patch removes the unnecessary check for NextHeader field and replace it
with ASSERT.
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/UefiPxeBcDxe')
-rw-r--r-- | NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c index dfc79a067b..720287583e 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c @@ -279,14 +279,11 @@ PxeBcIcmpErrorDpcHandle ( gBS->SignalEvent (RxData->RecycleSignal);
goto ON_EXIT;
}
-
- if (RxData->Header->Protocol != EFI_IP_PROTO_ICMP) {
- //
- // The protocol value in the header of the receveid packet should be EFI_IP_PROTO_ICMP.
- //
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
- }
+
+ //
+ // The protocol has been configured to only receive ICMP packet.
+ //
+ ASSERT (RxData->Header->Protocol == EFI_IP_PROTO_ICMP);
Type = *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer);
@@ -416,13 +413,10 @@ PxeBcIcmp6ErrorDpcHandle ( goto ON_EXIT;
}
- if (RxData->Header->NextHeader != IP6_ICMP) {
- //
- // The nextheader in the header of the receveid packet should be IP6_ICMP.
- //
- gBS->SignalEvent (RxData->RecycleSignal);
- goto ON_EXIT;
- }
+ //
+ // The protocol has been configured to only receive ICMP packet.
+ //
+ ASSERT (RxData->Header->NextHeader == IP6_ICMP);
Type = *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer);
|