From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 DFA1281C9C for ; Tue, 22 Nov 2016 05:08:22 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 22 Nov 2016 05:08:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,533,1473145200"; d="scan'208";a="1088898626" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 22 Nov 2016 05:08:22 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Nov 2016 05:08:22 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Nov 2016 05:08:22 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.138]) with mapi id 14.03.0248.002; Tue, 22 Nov 2016 21:08:20 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Zhang, Lubo" Thread-Topic: [edk2] [Patch] MdeModulePkg/DxeNetLib: Allow the IPv4/prefix case when AsciiStrToIp4 Thread-Index: AQHSQW8GeIjpGgT130WpZrF9sunSS6DlABEg Date: Tue, 22 Nov 2016 13:08:19 +0000 Message-ID: References: <1479454815-140484-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1479454815-140484-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDE3ODZjOTQtZDhlZS00YmE2LTkwYzUtZWQ2YzNkMWFmNjg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InNkWnZGSkNxR21MRUNYMmVIZ25UTFdmTjc3YTdhUjBMQkU3djN6NFNwaFU9In0= x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg/DxeNetLib: Allow the IPv4/prefix case when AsciiStrToIp4 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: Tue, 22 Nov 2016 13:08:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Jiaxin Wu > Sent: Friday, November 18, 2016 3:40 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Zhang, Lubo ; Fu, > Siyuan > Subject: [edk2] [Patch] MdeModulePkg/DxeNetLib: Allow the IPv4/prefix cas= e > when AsciiStrToIp4 >=20 > This patch is used to allow the IPv4 with prefix case. >=20 > Cc: Fu Siyuan > Cc: Ye Ting > Cc: Zhang Lubo > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiaxin Wu > --- > MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > index 04d8345..0804052 100644 > --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c > @@ -2722,13 +2722,21 @@ NetLibAsciiStrToIp4 ( >=20 > for (Index =3D 0; Index < 4; Index++) { > TempStr =3D Ip4Str; >=20 > while ((*Ip4Str !=3D '\0') && (*Ip4Str !=3D '.')) { > - if (!NET_IS_DIGIT (*Ip4Str)) { > + if (Index !=3D 3 && !NET_IS_DIGIT (*Ip4Str)) { > return EFI_INVALID_PARAMETER; > } > + > + // > + // Allow the IPv4 with prefix case, e.g. 192.168.10.10/24 > + // > + if (Index =3D=3D 3 && !NET_IS_DIGIT (*Ip4Str) && *Ip4Str !=3D '/')= { > + return EFI_INVALID_PARAMETER; > + } > + > Ip4Str++; > } >=20 > // > // The IPv4 address is X.X.X.X > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel