]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
libefivar: Fix iSCSI.Lun byte order issue
authorJose Luis Duran <jlduran@gmail.com>
Wed, 23 Feb 2022 20:42:01 +0000 (17:42 -0300)
committerWarner Losh <imp@FreeBSD.org>
Sun, 27 Feb 2022 16:12:52 +0000 (09:12 -0700)
Obtained from: https://github.com/tianocore/edk2/commit/19f21ed91652d2a5160426ad8ca9219728d85aec
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581

lib/libefivar/efivar-dp-format.c

index 8aa8a4798389c3fed3bff1481dd030316cf8ba28..bc21ba54a0989567a2baf83504717b0726e305f3 100644 (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");