>>      please clarify.  are you suggesting that, for getaddrinfo(3) AI_PASSIVE
>>      case:
>>      - on platforms that makes :: and 0.0.0.0 conflict on bind(2),
>>        dual stack kernel config: getaddrinfo(3) returns :: only.
>>        IPv6 only kernel config: getaddrinfo(3) returns :: only.
>>        IPv4 only kernel config: getaddrinfo(3) returns 0.0.0.0 only.
>>        this case includes linux.
>>      - on platforms that makes :: and 0.0.0.0 do not conflict on bind(2),
>>        dual stack kernel config: getaddrinfo(3) returns :: and 0.0.0.0.
>>        IPv6 only kernel config: getaddrinfo(3) returns :: only.
>>        IPv4 only kernel config: getaddrinfo(3) returns 0.0.0.0 only.
>>        this case includes OpenBSD, NetBSD, FreeBSD.
>That's exactly what I was talking about. It's for me the least desired of
>the proposed solutions, but it's enough for my purposes.

        if so, you will have problem in linux case...  i guess it is not the
        best route to change getaddrinfo(3) like above.  i guess it better to
        ignore certain error results.

        for example: on linux system, if you would like to turn IPV6_V6ONLY
        option on, you can only accept IPv6 traffic with getaddrinfo(3) loop.

itojun


-- the loop fails to accept IPv4 traffic on linux.
hints.ai_flags = AI_PASSIVE;
getaddrinfo(NULL, "80", &hints, &res0);
for (res = res0; res; res = res->ai_next) {
        s[i] = socket();
        if (res->ai_family == AF_INET6)
                setsockopt(s[i], IPV6_V6ONLY, on);

        bind(s[i]);
        listen(s[i]);
        i++;
}
--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to