NetworkPkg: Correct the proxy DHCP offer handing

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>
This commit is contained in:
Jiaxin Wu 2017-04-17 11:26:34 +08:00
parent ad18ec9543
commit 8cdd559be6
2 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Functions implementation related with DHCPv4 for UefiPxeBc Driver. Functions implementation related with DHCPv4 for UefiPxeBc Driver.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -870,7 +870,8 @@ PxeBcCacheDhcp4Offer (
// //
Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum; Private->OfferIndex[OfferType][Private->OfferCount[OfferType]] = Private->OfferNum;
Private->OfferCount[OfferType]++; Private->OfferCount[OfferType]++;
} else if (Private->OfferCount[OfferType] > 0) { } else if ((OfferType == PxeOfferTypeProxyPxe10 || OfferType == PxeOfferTypeProxyWfm11a) &&
Private->OfferCount[OfferType] < 1) {
// //
// Only cache the first PXE10/WFM11a offer, and discard the others. // Only cache the first PXE10/WFM11a offer, and discard the others.
// //

View File

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