On 02/20/09 19:33, Peter Memishian wrote:

 > After running "ifconfig -a6 down", this call to getaddrinfo() continues to 
return an IPv6 address (in addition to IPv4):
> > memset(&hints, 0, sizeof(hints));
 >   hints.ai_family = AF_UNSPEC;
 >   hints.ai_socktype = SOCK_STREAM;
 >   hints.ai_flags = AI_ADDRCONFIG;
 >   hints.ai_flags |= AI_PASSIVE;
> > error = getaddrinfo(NULL, "80", &hints, &ai_list); > > but an attempt to connect() to the returned IPv6 address results in ENETUNREACH. > > With AI_ADDRCONFIG, getaddrinfo() should consider only non-loopback
 > interfaces in determining whether to try to return an IPv6 address.

Yes, this is a bug in the implementation: the manpage is quite clear that
loopback addresses should not be considered valid, but the code that
implements AI_ADDRCONFIG just does:

        /* XXX errno */
        s = socket(af, SOCK_DGRAM, 0);
        if (s < 0) {
                if (errno != EMFILE)
                        return 0;
        } else
                close(s);
        return 1;

I suspect this bug has become more apparent now that loopback is enabled
by default.  Looks like this may also be tied to 6743041.

In any case, I'll get a bug logged on this.  Thanks!

Thanks. Jeff put this out there because I was seeing tons of errors in Apache2 logs on S10 10/08. I am going to have to go back and see if this happens in an earlier update. It does.

In my case, both in the global zone and an exclusive IP Instance (not that it should make a difference) non-global zone, I don't configure IPv6 at all (there is no lo6), and I get this behavior.

I also commented out ::1 in /etc/hosts, and that did not have an effect.

Steffen

--
meem
_______________________________________________
networking-discuss mailing list
[email protected]

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to