]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/UefiDevicePathLib: Fix the wrong MAC address length
authorJiaxin Wu <jiaxin.wu@intel.com>
Fri, 10 Mar 2017 06:45:12 +0000 (14:45 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Wed, 15 Mar 2017 07:01:39 +0000 (15:01 +0800)
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>
MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c

index ae38859542de4b3ecac969bd7777e8acc08784b7..a52cbef48f45b7a3c391a8d2de2e87f1495c5662 100644 (file)
@@ -1800,6 +1800,10 @@ DevPathFromTextMAC (
   MACDevPath->IfType   = (UINT8) Strtoi (IfTypeStr);\r
 \r
   Length = sizeof (EFI_MAC_ADDRESS);\r
+  if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) {\r
+    Length = 6;\r
+  }\r
+\r
   StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Length);\r
 \r
   return (EFI_DEVICE_PATH_PROTOCOL *) MACDevPath;\r