]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg/UefiDevicePathLib: Refine the DevPathFromTextiSCSI protocol parsing
authorJiaxin Wu <jiaxin.wu@intel.com>
Fri, 24 Mar 2017 01:53:50 +0000 (09:53 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Thu, 30 Mar 2017 03:32:24 +0000 (11:32 +0800)
commit7571a1c191e19b48d33a33c8b7763b49999700ee
treeb31dd096c51041a70e45b44c2bc16597132bb8d8
parenteed4585ba5915733a88fbb69d565c5e3247753f2
MdePkg/UefiDevicePathLib: Refine the DevPathFromTextiSCSI protocol parsing

For current iSCSI protocol parsing, UINT16 truncation may be happened. Since
the Spec already have declaimed that 0 is TCP Protocol and 1+ is reserved, the
parsing can be refined as below:

  if (StrCmp (ProtocolStr, L"TCP") == 0) {
    ISCSIDevPath->NetworkProtocol = 0;
  } else {
    //
    // Undefined and reserved.
    //
    ISCSIDevPath->NetworkProtocol = 1;
  }

Cc: Warner Losh <imp@bsdimp.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c