* subversion/svnserve/main.c
(main): Add --noipv6 option, and if set do not bind to an ipv6 port
On at least one system I am using (OpenBSD) the 1.2.0 version of
svnserve detects there is an ipv6 network, and binds to that network
ONLY. So there is no listening port setup on ipv4, so no ipv4 clients
can connect.
As I do not use ipv6 I added an option --noipv6 which will force it to
bind to the ipv4 network as previous versions did.
Others with both ipv6 and ipv4 on their systems may encounter similar
problems as I do not think this is specific to OpenBSD.
Ideally the fix should actually allow it to bind to both ipv6 and ipv4
networks, however that fix is beyond me at the moment.
(Sorry I resubmitted this as my editor decided to reformat the patch
file with tabs, hopefully this patch has the correct indenting)
Index: main.c
===================================================================
--- main.c (revision 14826)
+++ main.c (working copy)
@@ -96,7 +96,9 @@
#define SVNSERVE_OPT_FOREGROUND 258
#define SVNSERVE_OPT_TUNNEL_USER 259
#define SVNSERVE_OPT_VERSION 260
+#define SVNSERVE_OPT_NOIPV6 261
+
static const apr_getopt_option_t svnserve__options[] =
{
{"daemon", 'd', 0, N_("daemon mode")},
@@ -119,6 +121,9 @@
{"threads", 'T', 0, N_("use threads instead of fork")},
#endif
{"listen-once", 'X', 0, N_("listen once (useful for debugging)")},
+#if APR_HAVE_IPV6
+ {"noipv6", SVNSERVE_OPT_NOIPV6, 0, N_("disable ipv6")},
+#endif
{0, 0, 0, 0}
};
@@ -257,7 +262,8 @@
const char *host = NULL;
int family = APR_INET;
int mode_opt_count = 0;
-
+ int useipv6= 1;
+
/* Initialize the app. */
if (svn_cmdline_init("svn", stderr) != EXIT_SUCCESS)
return EXIT_FAILURE;
@@ -368,7 +374,12 @@
case 'T':
handling_mode = connection_mode_thread;
break;
- }
+#if APR_HAVE_IPV6
+ case SVNSERVE_OPT_NOIPV6:
+ useipv6= 0;
+ break;
+#endif
+ }
}
if (os->ind != argc)
usage(argv[0], pool);
@@ -407,17 +418,20 @@
create IPV6 sockets. */
#if APR_HAVE_IPV6
+ if (useipv6 != 0)
+ {
#ifdef MAX_SECS_TO_LINGER
/* ### old APR interface */
- status = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, pool);
+ status = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, pool);
#else
- status = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, APR_PROTO_TCP,
- pool);
+ status = apr_socket_create(&sock, APR_INET6, SOCK_STREAM, APR_PROTO_TCP,
+ pool);
#endif
- if (status == 0)
- {
- apr_socket_close(sock);
- family = APR_UNSPEC;
+ if (status == 0)
+ {
+ apr_socket_close(sock);
+ family = APR_UNSPEC;
+ }
}
#endif
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 24 23:22:19 2005