* Re: [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length
2017-03-10 6:47 [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length Jiaxin Wu
@ 2017-03-10 8:56 ` Ni, Ruiyu
2017-03-15 6:52 ` Ye, Ting
2017-03-15 6:55 ` Fu, Siyuan
2 siblings, 0 replies; 4+ messages in thread
From: Ni, Ruiyu @ 2017-03-10 8:56 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org
Cc: Ye, Ting, Fu, Siyuan, Wu, Jiaxin, Gao, Liming
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Thanks/Ray
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Friday, March 10, 2017 2:47 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan
> <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: [edk2] [Patch] 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>
> ---
> MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
> b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
> index ae38859..a52cbef 100644
> --- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
> +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
> @@ -1798,10 +1798,14 @@ 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;
> }
>
> --
> 1.9.5.msysgit.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length
2017-03-10 6:47 [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length Jiaxin Wu
2017-03-10 8:56 ` Ni, Ruiyu
@ 2017-03-15 6:52 ` Ye, Ting
2017-03-15 6:55 ` Fu, Siyuan
2 siblings, 0 replies; 4+ messages in thread
From: Ye, Ting @ 2017-03-15 6:52 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org
Cc: Ni, Ruiyu, Fu, Siyuan, Wu, Jiaxin, Gao, Liming
Reviewed-by: Ye Ting <ting.ye@intel.com>
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Friday, March 10, 2017 2:47 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch] 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>
---
MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index ae38859..a52cbef 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1798,10 +1798,14 @@ 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; }
--
1.9.5.msysgit.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length
2017-03-10 6:47 [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length Jiaxin Wu
2017-03-10 8:56 ` Ni, Ruiyu
2017-03-15 6:52 ` Ye, Ting
@ 2017-03-15 6:55 ` Fu, Siyuan
2 siblings, 0 replies; 4+ messages in thread
From: Fu, Siyuan @ 2017-03-15 6:55 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org
Cc: Ni, Ruiyu, Ye, Ting, Wu, Jiaxin, Gao, Liming
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin Wu
Sent: 2017年3月10日 14:47
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch] 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>
---
MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index ae38859..a52cbef 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1798,10 +1798,14 @@ 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; }
--
1.9.5.msysgit.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread