[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r13236 - in trunk: . subversion/svnserve

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2005-03-04 02:52:46 CET

On Fri, 2005-03-04 at 01:36 +0000, Philip Martin wrote:
> Daniel Berlin <dberlin@dberlin.org> writes:
> > Errr, then APR is doing something wrong.
> >
> > We use APR_UNSPEC when getting host info, which lets apr decide which
> > family to use.
> > If you have no ipv6 support, the lookup shouldn't given you an ipv6
> > family in it's return, which causes us to create an ipv6 socket.
> >
> > Nowhere do i explicitly create an ipv6 socket on my own in the code.
> > I'm not sure what to do here.
> >
> > Is APR_HAVE_IPV6 in apr.h defined to 1 or 0 on your system.
> It's defined as 1 despite the lack of IPV6 support in the kernel.
> Running configure I see
> Checking for IPv6 Networking support...
> checking for library containing getaddrinfo... none required
> checking for library containing gai_strerror... none required
> checking for library containing getnameinfo... none required
> checking for gai_strerror... yes
> checking for working getaddrinfo... yes
> checking for negative error codes for getaddrinfo... yes
> checking for working getnameinfo... yes
> checking for sockaddr_in6... yes
> checking if APR supports IPv6... yes
> so I guess APR only does compile time checks. I can use
> --disable-ipv6 to disable APR's IPV6 support.

I can reproduce your problem, i know what it is.

You have ::1 localhost and localhost in /etc/hosts

It prefers the ::1 over, and thus gives us back the ipv6
address, even though we can't even use ipv6.
This is dumb.

Server side, i can just add a -6 parameter and make people who want ipv6
support use it.

Client side, this is going to be stupid.
I'd have to do a v6 lookup and connect, then a v4 lookup and connect, or
I'm not sure what to do, i guess we have three options:

1. Say this an apr bug.
2. Say this is user error for having localhost resolve to ::1 when you
have no ipv6 support loaded
3. Prefer ipv4 over ipv6 (or vice versa) in the client.
4. Do the same runtime check neon does to see if we support ipv6 before
letting apr decide we can use it on it's own.

Neon avoids this problem by triyng to create an ipv6 socket at runtime
first, and if it fails, avoid asking anything about IPV6:

        hints.ai_family = ipv6_disabled ? AF_INET : AF_UNSPEC;
        addr->errnum = getaddrinfo(hostname, NULL, &hints,


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 4 02:54:07 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.