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

Re: 1.5 client can't connect to 1.4 svnserve

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 21 Mar 2008 21:10:49 +0100

On Fri, Mar 21, 2008 at 08:48:32PM +0100, Stefan Küng wrote:
> Karl Fogel wrote:
>> Stefan, you probably saw my mail just now saying that I can't reproduce
>> this. But in IRC, Eric Gillespie had an interesting thought:
>>
>> <epg> re: svnserve connection refused: maybe 1.5 is trying ipv6 and
>> then giving up?
>
> Yep, seems that way.
>
> file libsvn_ra_svn/client.c, function make_connection():
> if APR_HAVE_IPV6 is defined, then only ipv6 connections are used. If they
> fail, no ipv4 connection is tried before giving up.

Interesting...

Reading the docstring for apr_sockaddr_info_get in
/usr/local/include/apr-1/apr_network_io.h
makes me believe this could fix it (not tested though...)

Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 29983)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -108,6 +108,7 @@ static svn_error_t *make_connection(cons
   apr_sockaddr_t *sa;
   apr_status_t status;
   int family = APR_INET;
+ int flags = APR_IPV4_ADDR_OK;
 
   /* Make sure we have IPV6 support first before giving apr_sockaddr_info_get
      APR_UNSPEC, because it may give us back an IPV6 address even if we can't
@@ -124,11 +125,12 @@ static svn_error_t *make_connection(cons
     {
       apr_socket_close(*sock);
       family = APR_UNSPEC;
+ flags = APR_IPV6_ADDR_OK; /* prefer IPv6 over IPv4 */
     }
 #endif
 
   /* Resolve the hostname. */
- status = apr_sockaddr_info_get(&sa, hostname, family, port, 0, pool);
+ status = apr_sockaddr_info_get(&sa, hostname, family, port, flags, pool);
   if (status)
     return svn_error_createf(status, NULL, _("Unknown hostname '%s'"),
                              hostname);

-- 
Stefan Sperling <stsp_at_elego.de>                 Software Developer
elego Software Solutions GmbH                            HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12        Tel:  +49 30 23 45 86 96 
13355 Berlin                              Fax:  +49 30 23 45 86 95
http://www.elego.de                 Geschaeftsfuehrer: Olaf Wagner

  • application/pgp-signature attachment: stored
Received on 2008-03-21 21:11:03 CET

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.