From: "Fu, Siyuan" <siyuan.fu@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ye, Ting" <ting.ye@intel.com>, "Zhang, Lubo" <lubo.zhang@intel.com>
Subject: Re: [Patch] MdeModulePkg/DxeNetLib: Allow the IPv4/prefix case when AsciiStrToIp4
Date: Tue, 22 Nov 2016 13:08:19 +0000 [thread overview]
Message-ID: <B1FF2E9001CE9041BD10B825821D5BC58A853FD3@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1479454815-140484-1-git-send-email-jiaxin.wu@intel.com>
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: Friday, November 18, 2016 3:40 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Zhang, Lubo <lubo.zhang@intel.com>; Fu,
> Siyuan <siyuan.fu@intel.com>
> Subject: [edk2] [Patch] MdeModulePkg/DxeNetLib: Allow the IPv4/prefix case
> when AsciiStrToIp4
>
> This patch is used to allow the IPv4 with prefix case.
>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Zhang Lubo <lubo.zhang@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
> MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> 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 (
>
> for (Index = 0; Index < 4; Index++) {
> TempStr = Ip4Str;
>
> while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {
> - if (!NET_IS_DIGIT (*Ip4Str)) {
> + if (Index != 3 && !NET_IS_DIGIT (*Ip4Str)) {
> return EFI_INVALID_PARAMETER;
> }
> +
> + //
> + // Allow the IPv4 with prefix case, e.g. 192.168.10.10/24
> + //
> + if (Index == 3 && !NET_IS_DIGIT (*Ip4Str) && *Ip4Str != '/') {
> + return EFI_INVALID_PARAMETER;
> + }
> +
> Ip4Str++;
> }
>
> //
> // The IPv4 address is X.X.X.X
> --
> 1.9.5.msysgit.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
prev parent reply other threads:[~2016-11-22 13:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 7:40 [Patch] MdeModulePkg/DxeNetLib: Allow the IPv4/prefix case when AsciiStrToIp4 Jiaxin Wu
2016-11-22 13:08 ` Fu, Siyuan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B1FF2E9001CE9041BD10B825821D5BC58A853FD3@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox