NetworkPkg/HttpBootDxe: fix typo in DHCPv4 packet parsing

The string "HTTPClient" has 10 non-NUL characters; the value 9 is a
copy-paste leftover from "PXEClient". Check for all 10 characters in the
vendor-class-identifier option when determining whether the DHCP offer is
an HTTP offer.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
Laszlo Ersek 2018-03-22 14:22:40 +01:00
parent 699a2c30cb
commit 1ba4a4df39
1 changed files with 2 additions and 2 deletions

View File

@ -332,8 +332,8 @@ HttpBootParseDhcp4Packet (
// The offer with "HTTPClient" is a Http offer. // The offer with "HTTPClient" is a Http offer.
// //
Option = Options[HTTP_BOOT_DHCP4_TAG_INDEX_CLASS_ID]; Option = Options[HTTP_BOOT_DHCP4_TAG_INDEX_CLASS_ID];
if ((Option != NULL) && (Option->Length >= 9) && if ((Option != NULL) && (Option->Length >= 10) &&
(CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 9) == 0)) { (CompareMem (Option->Data, DEFAULT_CLASS_ID_DATA, 10) == 0)) {
IsHttpOffer = TRUE; IsHttpOffer = TRUE;
} }