>>>>> On Thu, 24 Apr 2003 08:41:53 +1000,
>>>>> [EMAIL PROTECTED] said:
> Is the following a legal IPv6 literal? The RFC's are unclear
> about whether leading zeros are allowed or not if they would
> make a segment more than 4 character wide.
> 1234:1234:1234:1234:01234::
> Note I would never expect inet_ntop() to produce the above.
> We were discussing this when reviewing our inet_pton()
> implementation.
Apparently there has been no consensus on this. The source of the
lack of consensus is an ambiguous text in RFC 3513:
1. The preferred form is x:x:x:x:x:x:x:x, where the 'x's are the
hexadecimal values of the eight 16-bit pieces of the address.
Some people interpret "01234" as a 16-bit piece, and others do not.
If we can only refer to this text, I don't think we can go further.
Meanwhile, a recent draft draft-main-ipaddr-text-rep-00.txt points out
that RFC 2373, the previous version of the address architecture RFC,
had an ABNF than invalidated "01234":
IPv6address = hexpart [ ":" IPv4address ]
IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
IPv6prefix = hexpart "/" 1*2DIGIT
hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ]
hexseq = hex4 *( ":" hex4)
hex4 = 1*4HEXDIG
And the draft itself defines a revised and precise version of the
ABNF, which also prohibits "01234" from being used as a "16-bit
piece."
I don't remember why the ABNF was removed in RFC 3513, but, regardless
of the reason, I believe the address architecture authors actually
intend at most four hex digits.
So, assuming we can agree on draft-main-ipaddr-text-rep-00.txt and the
draft will clarify RFC 3513, can we conclude here that inet_pton()
should reject more than four hex digits as a 16-bit piece?
JINMEI, Tatuya
Communication Platform Lab.
Corporate R&D Center, Toshiba Corp.
[EMAIL PROTECTED]
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page: http://playground.sun.com/ipng
FTP archive: ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [EMAIL PROTECTED]
--------------------------------------------------------------------