summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;