mirror of
https://github.com/utmapp/edk2.git
synced 2026-12-01 14:00:40 -10:00
MdePkg/DevicePathFromText: Fix byte orders of iSCSI.Lun
Per UEFI spec, iSCSI.Lun is a 8-byte array with byte #0 in the left. It means "0102030405060708" should be converted to: UINT8[8] = {01, 02, 03, 04, 05, 06, 07, 08} or UINT64 = {0807060504030201} Today's implementation wrongly uses the reversed order. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <[email protected]> Cc: Jie Lin <[email protected]> Reviewed-by: Liming Gao <[email protected]> Cc: Yonghong Zhu <[email protected]>
This commit is contained in:
1 parent
e6c80aea71
commit
d0196be1e3
1 file changed
+3
-1
@@ -2542,6 +2542,7 @@ DevPathFromTextiSCSI (
|
||||
CHAR16 *ProtocolStr;
|
||||
CHAR8 *AsciiStr;
|
||||
ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath;
|
||||
UINT64 Lun;
|
||||
|
||||
NameStr = GetNextParamStr (&TextDeviceNode);
|
||||
PortalGroupStr = GetNextParamStr (&TextDeviceNode);
|
||||
@@ -2560,7 +2561,8 @@ DevPathFromTextiSCSI (
|
||||
StrToAscii (NameStr, &AsciiStr);
|
||||
|
||||
ISCSIDevPath->TargetPortalGroupTag = (UINT16) Strtoi (PortalGroupStr);
|
||||
Strtoi64 (LunStr, &ISCSIDevPath->Lun);
|
||||
Strtoi64 (LunStr, &Lun);
|
||||
WriteUnaligned64 ((UINT64 *) &ISCSIDevPath->Lun, SwapBytes64 (Lun));
|
||||
|
||||
Options = 0x0000;
|
||||
if (StrCmp (HeaderDigestStr, L"CRC32C") == 0) {
|
||||
|
||||
Reference in new issue
Block a user