libefivar: Fix iSCSI.Lun byte order issue

Obtained from:	19f21ed916
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581
This commit is contained in:
Jose Luis Duran 2022-02-23 17:42:01 -03:00 committed by Warner Losh
parent acfee0131a
commit 50668299b3

View File

@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
DevicePathToText protocol as defined in the UEFI 2.0 specification.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2013 - 2018, 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
@ -1601,18 +1601,20 @@ DevPathToTextiSCSI (
{
ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath;
UINT16 Options;
UINTN Index;
ISCSIDevPath = DevPath;
UefiDevicePathLibCatPrint (
Str,
"iSCSI(%s,0x%x,0x%lx,",
"iSCSI(%s,0x%x,0x",
ISCSIDevPath->TargetName,
ISCSIDevPath->TargetPortalGroupTag,
ISCSIDevPath->Lun
ISCSIDevPath->TargetPortalGroupTag
);
for (Index = 0; Index < sizeof (ISCSIDevPath->Lun) / sizeof (UINT8); Index++) {
UefiDevicePathLibCatPrint (Str, "%02x", ((UINT8 *)&ISCSIDevPath->Lun)[Index]);
}
Options = ISCSIDevPath->LoginOption;
UefiDevicePathLibCatPrint (Str, "%s,", (((Options >> 1) & 0x0001) != 0) ? "CRC32C" : "None");
UefiDevicePathLibCatPrint (Str, ",%s,", (((Options >> 1) & 0x0001) != 0) ? "CRC32C" : "None");
UefiDevicePathLibCatPrint (Str, "%s,", (((Options >> 3) & 0x0001) != 0) ? "CRC32C" : "None");
if (((Options >> 11) & 0x0001) != 0) {
UefiDevicePathLibCatPrint (Str, "%s,", "None");