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:	e6c80aea71
Pull Request:   https://github.com/freebsd/freebsd-src/pull/581
This commit is contained in:
Jose Luis Duran 2022-02-23 22:46:19 -03:00 committed by Warner Losh
parent d9d1a1e7ab
commit 76ed5f1b26

View file

@ -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 {
//