From nobody Sat Nov 2 12:27:41 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489128448804677.6783402985877; Thu, 9 Mar 2017 22:47:28 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F123E803A8; Thu, 9 Mar 2017 22:47:26 -0800 (PST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5D0B1803A7 for ; Thu, 9 Mar 2017 22:47:26 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 09 Mar 2017 22:47:26 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.127]) by fmsmga004.fm.intel.com with ESMTP; 09 Mar 2017 22:47:24 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,139,1486454400"; d="scan'208";a="234472426" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Fri, 10 Mar 2017 14:47:23 +0800 Message-Id: <1489128443-108752-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Ye Ting , Fu Siyuan , Wu Jiaxin , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Cc: Ruiyu Ni Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Ruiyu Ni Reviewed-by: Ye Ting =20 --- 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 ( ); =20 MACDevPath->IfType =3D (UINT8) Strtoi (IfTypeStr); =20 Length =3D sizeof (EFI_MAC_ADDRESS); + if (MACDevPath->IfType =3D=3D 0x01 || MACDevPath->IfType =3D=3D 0x00) { + Length =3D 6; + } + StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Leng= th); =20 return (EFI_DEVICE_PATH_PROTOCOL *) MACDevPath; } =20 --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel