]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Correct the proxy DHCP offer handing
authorJiaxin Wu <jiaxin.wu@intel.com>
Mon, 17 Apr 2017 03:26:34 +0000 (11:26 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Fri, 21 Apr 2017 05:04:53 +0000 (13:04 +0800)
When PXE10/WFM11a offer received, we should only cache
the first PXE10/WFM11a offer, and discard the others. But
Current we discard all PXE10/WFM11a offer. This patch is
to fix this issue.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c

index 54973901190c3abaf4abb77b0ef5cb2398fd3310..97829e984267b35719bd5e10b7543f7f2f8c2bf3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Functions implementation related with DHCPv4 for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -870,7 +870,8 @@ PxeBcCacheDhcp4Offer (
         //\r
         Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum;\r
         Private->OfferCount[OfferType]++;\r
-      } else if (Private->OfferCount[OfferType] > 0) {\r
+      } else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) && \r
+                 Private->OfferCount[OfferType] < 1) {\r
         //\r
         // Only cache the first PXE10/WFM11a offer, and discard the others.\r
         //\r
index a295b827afbca7a37e165cc2144bca85b0625e8c..4cd17707505b8502b1d9b13c82088488c3aefe7d 100644 (file)
@@ -2,7 +2,7 @@
   Functions implementation related with DHCPv6 for UefiPxeBc Driver.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -1197,7 +1197,8 @@ PxeBcCacheDhcp6Offer (
       //\r
       Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum;\r
       Private->OfferCount[OfferType]++;\r
-    } else if (Private->OfferCount[OfferType] > 0) {\r
+    } else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) && \r
+                 Private->OfferCount[OfferType] < 1) {\r
       //\r
       // Only cache the first PXE10/WFM11a offer, and discard the others.\r
       //\r