summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2017-03-10 14:45:12 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-03-15 15:01:39 +0800
commit2d67f2bae32040c77af8097a8ef1be272cb00e28 (patch)
tree5d2a30aaac8c667810525eb6d0aa0d3e7e5df4ac
parentf4fc7d53046e5ce7a4ae1cf586c289fdbebcbb4a (diff)
downloadedk2-platforms-2d67f2bae32040c77af8097a8ef1be272cb00e28.tar.xz
MdePkg/UefiDevicePathLib: Fix the wrong MAC address length
Network interface type should be checked before the conversion between text device path node and MAC device path. Otherwise, the MAC text string can't be converted to the representation of a device node, which leads to the series failure of network HII configuration(e.g. IP, VLAN, HTTP Boot configuration in Network Device List). Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.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: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index ae38859542..a52cbef48f 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1800,6 +1800,10 @@ DevPathFromTextMAC (
MACDevPath->IfType = (UINT8) Strtoi (IfTypeStr);
Length = sizeof (EFI_MAC_ADDRESS);
+ if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) {
+ Length = 6;
+ }
+
StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Length);
return (EFI_DEVICE_PATH_PROTOCOL *) MACDevPath;