From: JuanJo Ciarlante Date: Tue, 15 Sep 2009 20:42:46 +0000 (+0200) Subject: * important fix for tcp6 reconnection X-Git-Tag: v2.3-alpha1~240^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97549c67678bb9b5196d4a87971e9fde6147cce0;p=thirdparty%2Fopenvpn.git * important fix for tcp6 reconnection was incorrectly creating a PF_INET socket --- diff --git a/socket.c b/socket.c index 01c18e9c4..344c0dd26 100644 --- a/socket.c +++ b/socket.c @@ -1251,7 +1251,20 @@ socket_connect (socket_descriptor_t *sd, if (*signal_received) goto done; - *sd = create_socket_tcp (); +#ifdef USE_PF_INET6 + switch(local->addr.sa.sa_family) + { + case PF_INET6: + *sd = create_socket_tcp6 (); + break; + case PF_INET: +#endif + *sd = create_socket_tcp (); +#ifdef USE_PF_INET6 + break; + } +#endif + if (bind_local) socket_bind (*sd, local, "TCP Client"); update_remote (remote_dynamic, remote, remote_changed, sockflags);