Hi Gary,

The issue has been gone since the version of 
9f5ca5efbd0bb00c9d3577b95e6322e85cb0b118. Please check that.

Thanks,
Jiaxin

> -----Original Message-----
> From: edk2-devel [mailto:[email protected]] On Behalf Of
> Guoheyi
> Sent: Wednesday, April 5, 2017 6:56 PM
> To: [email protected]
> Cc: Tian, Feng <[email protected]>; Wu, Jiaxin <[email protected]>; Fu,
> Siyuan <[email protected]>; Zeng, Star <[email protected]>
> 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
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to