IPv6 help (Re: inetutils, r* commands)

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Mar 17 14:23:00 GMT 2010


On Mar 17 12:53, Corinna Vinschen wrote:
> I tested this a bit, see the test application attached to this mail.

Well, it's attached *now* at least.

I just found that the returned values in the AF_INET6 + AI_ALL|AI_V4MAPPED
case depends on the GLibc version.  This is the output on a Linux machine
running glibc 2.9 (and on Cygwin/Windows):

  $ ./getaddrinfo some_other_linx_box
  [...]
  10   18
    AF_INET6 fc00::d (1)
    AF_INET6 ::ffff:192.168.129.107 (1)

And this is the output on a machine running glibc 2.10 or 2.11:

  $ ./getaddrinfo some_other_linx_box
  [...]
  10   18
    AF_INET  192.168.129.107 (1)
    AF_INET6 fc00::d (1)

Note that AF_INET is returned even though ai_family is set to AF_INET6.
This appears to be an interesting interpretation of POSIX-1.2008:

  If the AI_V4MAPPED flag is specified along with an ai_family of
  AF_INET6, then getaddrinfo() shall return IPv4-mapped IPv6 addresses
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  on finding no matching IPv6 addresses ( ai_addrlen shall be 16). The
  AI_V4MAPPED flag shall be ignored unless ai_family equals AF_INET6. If
  the AI_ALL flag is used with the AI_V4MAPPED flag, then getaddrinfo()
  shall return all matching IPv6 and IPv4 addresses. The AI_ALL flag
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  without the AI_V4MAPPED flag is ignored.

If that's really the blessed behaviour, we could do the same in one of
the next Cygwin releases by converting V4inV6 addresses to plain V4
addresses.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getaddrinfo.c
Type: text/x-c++src
Size: 1868 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100317/7773ac06/attachment.bin>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list