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

Regression in svnserve: IPv6 causes IPv4 not to work [was: Branching for 1.3.]

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-09-22 02:33:18 CEST

Sigfred Håversen wrote:
> On OpenBSD a "svnserve -d -r /my/repo" would only listen on IPv6 3690:*,
> but the common case for users is to use IPv4. The work-around is to supply
> --listen-host with a hostname resolving to an IPv4 adress, but that may fail
> if you want to listen on all interfaces.

In a private mail to me, Sigfred asserted that this is a regression from
previous behaviour (before support for IPv6 was added).

Can anyone else confirm or deny this?

> What I suggest is that svnserve listen on IPv4 by default, but an --ipv6
> option gives the user the behaviour svnserve currently has.

Well, that might be a solution if no automatic solution can be implemented.

Sigfred Håversen wrote:
> Michael Sweet wrote:
>> Having just completed the IPv6 support code for CUPS 1.2, the best
>> thing to do is to conditionally set the IPV6_V6ONLY socket option,
>> e.g.:
>>
>> #ifdef IPV6_V6ONLY
>> int val = 0;
>> setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &val, sizeof(val));
>> #endif /* IPV6_V6ONLY */
>>
>> I'm not sure how to do this with APR calls, but basically *BSD
>> defaults IPv6 sockets to only listen for IPv6 connections - you
>> have to use the above setsockopt magic to get a single socket
>> to accept both IPv6 and IPv4 connections.

OK. I don't know anything about this; if you say that's the way to do it, I'll
believe you. Does anyone else agree or dispute this?

If nobody disputes this, is somebody willing to write and send the actual patch
to do this? Will it work and solve the problem?

Sigfred, I cannot understand what you mean to say in the whole message that I
quote below here. Could you say it in a different way?

- Julian

> I'm vary touching the socket creating part in svnserve, except
> adding a test like "if (use_ipv6)" around creating of IPv6 socket.
> Anything else might break something one in one OS or another.
>
> I should have searched the mailinglists properly... However,
> in May (thread "[PATCH] Add option to svnserve to disable ipv6")
> there was a patch almost identical to mine that was rejected, so
> I see no point in sending in the patch I've prepared.
>
> In the same thread there is a patch that does not work:
>
> Index: subversion/svnserve/main.c
> ===================================================================
> --- subversion/svnserve/main.c (revision 15318)
> +++ subversion/svnserve/main.c (working copy)
> @@ -452,6 +452,12 @@
> * restarted. */
> apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1);
>
> +#if APR_HAVE_IPV6
> + /* Allows IPV4 connections to a V6 socket */
> + if (APR_INET6 == sa->family)
> + apr_socket_opt_set(sock, APR_IPV6_V6ONLY, 0);
> +#endif
> +
> status = apr_socket_bind(sock, sa);
> if (status)
> {
>
>
> I wrote the patch the way I did because (thread "svn 1.2.x
> cannot reach dual-stack svnserve with IPv4", July) what
> Daniel Berlin wrote:
>
> [snip] "I'm tempted to just give up any pretense of ipv6 support and remove the
> existing code that deals with it in svnserve.
> It seems it's been a lot more trouble than it's worth, because things
> like to tell us about ipv6 addresses, etc, when the actual machine can't
> support it.
>
> Maybe in 5 or 6 years when someone gets this right we should reimplement.
> --Dan
> "
>
> /Sigfred

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 22 02:34:14 2005

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