Wireshark-dev: Re: [Wireshark-dev] IPv6 longest representation vs INET6_ADDRSTRLEN
From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Thu, 05 May 2011 10:41:42 -0700
On 5/5/11 6:01 AM, Jakub Zawadzki wrote:
> On Thu, May 05, 2011 at 02:01:06PM +0200, Jakub Zawadzki wrote:
>> IMHO when IPv4-mapping is used the longest address is:
>> ::ffff:255.255.255.255 (22B)
>>
>> Anyone knows inet_ntop(AF_INET6, ..) implementation which can actually use 46 bytes?
>  
> Maybe some inet_ntop() implementation don't generate short addresses? (0000 instead of ::)
> so ipv4 mapped address would be: "0000:0000:0000:0000:0000:0000:255.255.255.255"
> 
> I think I'll just copy inet_ntop6() from wsutil/inet_ntop.c to address_to_str.c...

RFC 2553 section 6.6 and MSDN's InetNtop documentation both specify 46
characters, but you'd think that if an implementation was smart enough
to check for v4-mapped addresses it would be smart enough to compress
zeroes.

-- 
Join us for Sharkfest ’11! · Wireshark® Developer and User Conference
Stanford University, June 13-16 · http://sharkfest.wireshark.org