git: 76ed5f1b2622 - main - libefivar: Fix bug when converting iSCSI node

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sun, 27 Feb 2022 16:47:41 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=76ed5f1b2622892dff0468c2c94ba0c27b6d3dde

commit 76ed5f1b2622892dff0468c2c94ba0c27b6d3dde
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2022-02-24 01:46:19 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-02-27 16:12:41 +0000

    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 b755ea4a6146..c527607c7184 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.<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
@@ -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 {
     //