]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Refine the error handling for PXE-v4 driver.
authorhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Aug 2011 08:48:23 +0000 (08:48 +0000)
committerhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Aug 2011 08:48:23 +0000 (08:48 +0000)
Signed-off-by: hhuan13
Reviewed-by: xdu2, tye
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12191 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h

index a9c86dc042bf1c2672843af73245a5a65a9d06e7..5f3d9135474259f4b4e36a0317b83f906be92fe1 100644 (file)
@@ -565,7 +565,9 @@ PxeBcCacheDhcpOffer (
   }\r
 \r
   OfferType = CachedOffer->OfferType;\r
-  ASSERT (OfferType < DHCP4_PACKET_TYPE_MAX);\r
+  if (OfferType >= DHCP4_PACKET_TYPE_MAX) {\r
+    return ;\r
+  }\r
 \r
   if (OfferType == DHCP4_PACKET_TYPE_BOOTP) {\r
 \r
index 304d7c89dd296d0d4364d3d1848c4f0a3bad5cb9..5e37228efa321a9e486e16d7d511fdc8246b2e51 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Dhcp and Discover routines for PxeBc.\r
 \r
-Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -116,8 +116,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define DHCP4_PACKET_TYPE_WFM11A           1\r
 #define DHCP4_PACKET_TYPE_BINL             2\r
 #define DHCP4_PACKET_TYPE_DHCP_ONLY        3\r
-#define DHCP4_PACKET_TYPE_MAX              4\r
-#define DHCP4_PACKET_TYPE_BOOTP            DHCP4_PACKET_TYPE_MAX\r
+#define DHCP4_PACKET_TYPE_BOOTP            4\r
+#define DHCP4_PACKET_TYPE_MAX              5\r
 \r
 #define BIT(x)  (1 << x)\r
 #define CTRL(x) (0x1F & (x))\r