summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-17 01:58:55 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-17 01:58:55 +0000
commitb1f8b9f69df4a077c2af41ffa88d7a7981c7192e (patch)
treefad1aa9cf57529c733351cea980dbc160577f841
parent5231be7997e0c308c547bccdae0e566c9a10df20 (diff)
downloadedk2-b1f8b9f69df4a077c2af41ffa88d7a7981c7192e.zip
edk2-b1f8b9f69df4a077c2af41ffa88d7a7981c7192e.tar.gz
edk2-b1f8b9f69df4a077c2af41ffa88d7a7981c7192e.tar.bz2
Sync patch r12191 from main trunk.
Refine the error handling for PXE-v4 driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UDK2010@12541 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c6
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
index 6b25cab..798f0a6 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
@@ -1,7 +1,7 @@
/** @file
Support for PxeBc dhcp functions.
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -565,7 +565,9 @@ PxeBcCacheDhcpOffer (
}
OfferType = CachedOffer->OfferType;
- ASSERT (OfferType < DHCP4_PACKET_TYPE_MAX);
+ if (OfferType >= DHCP4_PACKET_TYPE_MAX) {
+ return ;
+ }
if (OfferType == DHCP4_PACKET_TYPE_BOOTP) {
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
index 304d7c8..5e37228 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.h
@@ -1,7 +1,7 @@
/** @file
Dhcp and Discover routines for PxeBc.
-Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -116,8 +116,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define DHCP4_PACKET_TYPE_WFM11A 1
#define DHCP4_PACKET_TYPE_BINL 2
#define DHCP4_PACKET_TYPE_DHCP_ONLY 3
-#define DHCP4_PACKET_TYPE_MAX 4
-#define DHCP4_PACKET_TYPE_BOOTP DHCP4_PACKET_TYPE_MAX
+#define DHCP4_PACKET_TYPE_BOOTP 4
+#define DHCP4_PACKET_TYPE_MAX 5
#define BIT(x) (1 << x)
#define CTRL(x) (0x1F & (x))