From 76ed5f1b2622892dff0468c2c94ba0c27b6d3dde Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Wed, 23 Feb 2022 22:46:19 -0300 Subject: [PATCH] libefivar: Fix bug when converting iSCSI node If protocol string is not specified, default TCP(0) should be used. Today's implementation wrongly sets to 1 for this case. Obtained from: https://github.com/tianocore/edk2/commit/e6c80aea71c7b7c6c22ed779d23bf7877a97e68d Pull Request: https://github.com/freebsd/freebsd-src/pull/581 --- lib/libefivar/efivar-dp-parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libefivar/efivar-dp-parse.c b/lib/libefivar/efivar-dp-parse.c index b755ea4a614..c527607c718 100644 --- a/lib/libefivar/efivar-dp-parse.c +++ b/lib/libefivar/efivar-dp-parse.c @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); /** @file DevicePathFromText protocol as defined in the UEFI 2.0 specification. -Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
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 @@ -2725,7 +2725,7 @@ DevPathFromTextiSCSI ( ISCSIDevPath->LoginOption = (UINT16) Options; - if (StrCmp (ProtocolStr, "TCP") == 0) { + if (IS_NULL (*ProtocolStr) || (StrCmp (ProtocolStr, "TCP") == 0)) { ISCSIDevPath->NetworkProtocol = 0; } else { //