From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 3527A8039D for ; Tue, 14 Mar 2017 23:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489560740; x=1521096740; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=USD0ySZRNgu1EnjDMRktk5hw93RAmuvV6OtbcnbiSD4=; b=wcAb7puuXLdw2BBMU2ud4wB+2RGQjOP+ZasZqG0iWCn1XLbcDI7Gw2ls NDP7M7mP1VDQmaH0QueGjbPJgezBTQ==; Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2017 23:52:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,167,1486454400"; d="scan'208";a="1122716392" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 14 Mar 2017 23:52:18 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 14 Mar 2017 23:52:14 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 14 Mar 2017 23:52:14 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Wed, 15 Mar 2017 14:52:12 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Fu, Siyuan" , "Wu, Jiaxin" , "Gao, Liming" Thread-Topic: [edk2] [Patch] MdePkg/UefiDevicePathLib: Fix the wrong MAC address length Thread-Index: AQHSmWoyB1kuRIUs+kSBC0KJ8F/QeaGVfnPQ Date: Wed, 15 Mar 2017 06:52:11 +0000 Message-ID: References: <1489128443-108752-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1489128443-108752-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Wed, 15 Mar 2017 06:52:20 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting =20 -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiax= in Wu Sent: Friday, March 10, 2017 2:47 PM To: edk2-devel@lists.01.org Cc: Ni, Ruiyu ; Ye, Ting ; Fu, Siyua= n ; Wu, Jiaxin ; Gao, Liming 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 se= ries failure of network HII configuration(e.g. IP, VLAN, HTTP Boot configur= ation 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 --- 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 -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel