Author: grothoff Date: 2008-03-02 09:54:54 -0700 (Sun, 02 Mar 2008) New Revision: 6513
Modified: GNUnet/contrib/config-daemon.scm GNUnet/src/server/tcpserver.c GNUnet/src/transports/tcp.c GNUnet/src/transports/udp.c Log: added option to disable IPv6 support Modified: GNUnet/contrib/config-daemon.scm =================================================================== --- GNUnet/contrib/config-daemon.scm 2008-03-02 12:11:25 UTC (rev 6512) +++ GNUnet/contrib/config-daemon.scm 2008-03-02 16:54:54 UTC (rev 6513) @@ -404,6 +404,19 @@ 'rare) ) +(define (gnunetd-disable-ipv6 builder) + (builder + "GNUNETD" + "DISABLE-IPV6" + (_ "Set to YES to disable IPv6 support") + (_ "This option maybe useful on peers where the kernel does not support IPv6. You might also want to set this option if you do not have an IPv6 network connection.") + '() + #t + #t + #t + 'rare) ) + + (define (gnunetd-private-network builder) (builder "GNUNETD" @@ -575,6 +588,7 @@ (fs-path builder) (index-path builder) (daemon-fdlimit builder) + (gnunetd-disable-ipv6 builder) (general-username builder) (general-groupname builder) (general-pidfile builder) Modified: GNUnet/src/server/tcpserver.c =================================================================== --- GNUnet/src/server/tcpserver.c 2008-03-02 12:11:25 UTC (rev 6512) +++ GNUnet/src/server/tcpserver.c 2008-03-02 16:54:54 UTC (rev 6513) @@ -344,7 +344,9 @@ listenerPort = getGNUnetPort (); if (listenerPort == 0) return GNUNET_SYSERR; - if (-1 == (listenerFD = SOCKET (PF_INET6, SOCK_STREAM, 0))) + if ( (GNUNET_YES == GNUNET_GC_get_configuration_value_yesno (cfg, "GNUNETD", "DISABLE-IPV6", + GNUNET_YES)) || + (-1 == (listenerFD = SOCKET (PF_INET6, SOCK_STREAM, 0))) ) { listenerFD = SOCKET (PF_INET, SOCK_STREAM, 0); if (listenerFD < 0) Modified: GNUnet/src/transports/tcp.c =================================================================== --- GNUnet/src/transports/tcp.c 2008-03-02 12:11:25 UTC (rev 6512) +++ GNUnet/src/transports/tcp.c 2008-03-02 16:54:54 UTC (rev 6513) @@ -625,7 +625,7 @@ if ((i < 0) && (errno != EINPROGRESS) && (errno != EWOULDBLOCK)) { GNUNET_GE_LOG_STRERROR (coreAPI->ectx, - GNUNET_GE_ERROR | GNUNET_GE_ADMIN | + GNUNET_GE_DEBUG | GNUNET_GE_ADMIN | GNUNET_GE_USER | GNUNET_GE_BULK, "connect"); GNUNET_socket_destroy (s); return GNUNET_SYSERR; @@ -657,9 +657,10 @@ if (port != 0) { available_protocols = VERSION_AVAILABLE_NONE; - s = SOCKET (PF_INET6, SOCK_STREAM, 0); - if (s < 0) - { + if ( (GNUNET_YES == GNUNET_GC_get_configuration_value_yesno (cfg, "GNUNETD", "DISABLE-IPV6", + GNUNET_YES)) || + (0 > (s = SOCKET (PF_INET6, SOCK_STREAM, 0)) ) ) + { s = SOCKET (PF_INET, SOCK_STREAM, 0); if (s < 0) { Modified: GNUnet/src/transports/udp.c =================================================================== --- GNUnet/src/transports/udp.c 2008-03-02 12:11:25 UTC (rev 6512) +++ GNUnet/src/transports/udp.c 2008-03-02 16:54:54 UTC (rev 6513) @@ -272,11 +272,16 @@ int s; available_protocols = VERSION_AVAILABLE_NONE; + s = -1; + if (GNUNET_YES != GNUNET_GC_get_configuration_value_yesno (cfg, "GNUNETD", "DISABLE-IPV6", + GNUNET_YES)) + { #ifndef MINGW - s = SOCKET (PF_INET6, SOCK_DGRAM, 17); + s = SOCKET (PF_INET6, SOCK_DGRAM, 17); #else - s = win_ols_socket (PF_INET6, SOCK_DGRAM, 17); + s = win_ols_socket (PF_INET6, SOCK_DGRAM, 17); #endif + } if (s < 0) { #ifndef MINGW _______________________________________________ GNUnet-SVN mailing list GNUnet-SVN@gnu.org http://lists.gnu.org/mailman/listinfo/gnunet-svn