From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: 'Guoheyi' <guoheyi@huawei.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Tian, Feng" <feng.tian@intel.com>,
"Fu, Siyuan" <siyuan.fu@intel.com>,
"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [DxeNetLib] Why do we restrict each field to have the same leading zero format?
Date: Thu, 6 Apr 2017 05:30:21 +0000 [thread overview]
Message-ID: <895558F6EA4E3B41AC93A00D163B7274162BDDD4@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <B328F08581D714418202ABF306D3781C3AC11473@DGGEMA505-MBS.china.huawei.com>
Hi Gary,
The issue has been gone since the version of 9f5ca5efbd0bb00c9d3577b95e6322e85cb0b118. 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 <feng.tian@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Fu,
> Siyuan <siyuan.fu@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] [DxeNetLib] Why do we restrict each field to have the same
> leading zero format?
>
> Hi folks,
>
> We are using NetLibAsciiStrToIp6 function in DxeNetLib.c of MdeModulePkg
> to convert string to IPv6 address. We found this function will return invalid
> parameter with below input:
> 2001:3456:789a:0000:f012:2:2003:2005
>
> We trace the code and believe it is handled by the branch in line 2955:
>
> if ((Cnt != 0) && (Cnt < 4) && LeadZero) {
> return EFI_INVALID_PARAMETER;
> }
>
> I think the reason is that we have field 3 of "0000" which has leading zero 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.
>
> I checked RFC 4291 and only found below text; I didn't find any restriction
> that requires each field to have the same leading zero format.
>
> 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:
>
> ABCD:EF01:2345:6789:ABCD:EF01:2345:6789
>
> 2001:DB8:0:0:8:800:200C:417A
>
> 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.).
>
> Could you help to confirm whether it is a bug or there is some special reason
> for this?
>
> Thanks and regards,
>
> Gary (Heyi Guo)
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2017-04-06 5:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 10:55 [DxeNetLib] Why do we restrict each field to have the same leading zero format? Guoheyi
2017-04-06 5:30 ` Wu, Jiaxin [this message]
2017-04-06 7:35 ` 答复: " Guoheyi
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=895558F6EA4E3B41AC93A00D163B7274162BDDD4@SHSMSX103.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