]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix bug when converting iSCSI node
authorYonghong Zhu <yonghong.zhu@intel.com>
Fri, 2 Mar 2018 15:03:34 +0000 (23:03 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Sat, 3 Mar 2018 07:40:04 +0000 (15:40 +0800)
If protocol string is not specified, default TCP(0) should be used.
Today's implementation wrongly sets to 1 for this case.
Copy the fix solution from MdePkg Hash version e6c80aea.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/DevicePath/DevicePathFromText.c

index 776cf051b0d955044553461d20b457378ed897f1..fd310c7d0f75065ed910f143c0a7683f3f42962e 100644 (file)
@@ -2426,7 +2426,7 @@ DevPathFromTextiSCSI (
 \r
   ISCSIDevPath->LoginOption      = (UINT16) Options;\r
 \r
-  if (StrCmp (ProtocolStr, L"TCP") == 0) {\r
+  if (IS_NULL (*ProtocolStr) || (StrCmp (ProtocolStr, L"TCP") == 0)) {\r
     ISCSIDevPath->NetworkProtocol = 0;\r
   } else {\r
     //\r