summaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorJuanJo Ciarlante <jjo@google.com>2009-09-15 22:42:46 +0200
committerJuanJo Ciarlante <juanjosec@gmail.com>2011-03-25 13:30:29 +0100
commit97549c67678bb9b5196d4a87971e9fde6147cce0 (patch)
tree5250973fc47dcc962bc9f68a737d2ee0df10ba40 /socket.c
parent51afc8b8865fe09f76b81ae341e693a5b16199f2 (diff)
downloadopenvpn-97549c67678bb9b5196d4a87971e9fde6147cce0.tar.gz
openvpn-97549c67678bb9b5196d4a87971e9fde6147cce0.tar.xz
openvpn-97549c67678bb9b5196d4a87971e9fde6147cce0.zip
* important fix for tcp6 reconnection
was incorrectly creating a PF_INET socket
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index 01c18e9..344c0dd 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);