From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 1673B21942333 for ; Wed, 5 Apr 2017 22:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491456624; x=1522992624; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=U90pEpf8Mpky6HQQl03skj7sM62U8RDWAQrVWChpeyc=; b=fU9K50L5XZe5KWba3+CcSEE7Edmzr4c+PjhgCpaqB5jNq+kDy2JRLQXO 0Dlw9FDrCd1sTJE32EYc5xl/bTlgow==; Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2017 22:30:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,282,1488873600"; d="scan'208";a="1151753610" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 05 Apr 2017 22:30:23 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 5 Apr 2017 22:30:23 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 5 Apr 2017 22:30:23 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Thu, 6 Apr 2017 13:30:21 +0800 From: "Wu, Jiaxin" To: 'Guoheyi' , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Fu, Siyuan" , "Zeng, Star" Thread-Topic: [edk2] [DxeNetLib] Why do we restrict each field to have the same leading zero format? Thread-Index: AdKt+zTi9rTUxGx8ThGF9YVHIyc3FQAdhQjw Date: Thu, 6 Apr 2017 05:30:21 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162BDDD4@SHSMSX103.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzcwMDFhYTMtY2JmNS00MTlkLTlkOWMtNDZmYzUxODEyOTU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Im12UXNFZTJTMU9yem8xYWxyV2sxa042cU55MGpKRGhsYXR2OTVJSThoOFU9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [DxeNetLib] Why do we restrict each field to have the same leading zero format? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2017 05:30:24 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Gary, The issue has been gone since the version of 9f5ca5efbd0bb00c9d3577b95e6322= e85cb0b118. Please check that. Thanks, Jiaxin > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Guoheyi > Sent: Wednesday, April 5, 2017 6:56 PM > To: edk2-devel@lists.01.org > Cc: Tian, Feng ; Wu, Jiaxin ; F= u, > Siyuan ; Zeng, Star > Subject: [edk2] [DxeNetLib] Why do we restrict each field to have the sam= e > leading zero format? >=20 > Hi folks, >=20 > We are using NetLibAsciiStrToIp6 function in DxeNetLib.c of MdeModulePkg > to convert string to IPv6 address. We found this function will return inv= alid > parameter with below input: > 2001:3456:789a:0000:f012:2:2003:2005 >=20 > We trace the code and believe it is handled by the branch in line 2955: >=20 > if ((Cnt !=3D 0) && (Cnt < 4) && LeadZero) { > return EFI_INVALID_PARAMETER; > } >=20 > I think the reason is that we have field 3 of "0000" which has leading ze= ro and > causes LeadZero flag to be true, and it requires all the following fields= to have > the same leading zero format, while field 5 of "2" is not. >=20 > I checked RFC 4291 and only found below text; I didn't find any restricti= on > that requires each field to have the same leading zero format. >=20 > 1. The preferred form is x:x:x:x:x:x:x:x, where the 'x's are one to > four hexadecimal digits of the eight 16-bit pieces of the address. > Examples: >=20 > ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 >=20 > 2001:DB8:0:0:8:800:200C:417A >=20 > Note that it is not necessary to write the leading zeros in an > individual field, but there must be at least one numeral in every > field (except for the case described in 2.). >=20 > Could you help to confirm whether it is a bug or there is some special re= ason > for this? >=20 > Thanks and regards, >=20 > Gary (Heyi Guo) > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel