make inet_ntop format v4-mapped ipv6 addresses properly
commit1cd417bdf10366d63cc875e285c6418709a58c17
authorRich Felker <dalias@aerifal.cx>
Thu, 25 Jul 2013 07:20:02 +0000 (25 03:20 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 25 Jul 2013 07:20:02 +0000 (25 03:20 -0400)
tree232d9d35ba1da858c6da35e9513eb6cd3ce4361e
parent43d2531316270633589c67cf0c4d6d01e520a397
make inet_ntop format v4-mapped ipv6 addresses properly

based on a patch by orc. POSIX actually fails to specify the format of
the ntop conversion; presumably, any output that will correctly
round-trip back via the (well-specified) pton operation is acceptable.
the new behavior is much more convenient than the old, however.

this patch also affects getnameinfo, which is implemented in terms of
inet_ntop and which is the preferred interface for performing this
conversion.

I've also removed some inexplicable cruft (filling the buffer with 'x'
before doing anything) whose origin I was unable to track down.
src/network/inet_ntop.c