]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
* important fix for tcp6 reconnection
authorJuanJo Ciarlante <jjo@google.com>
Tue, 15 Sep 2009 20:42:46 +0000 (22:42 +0200)
committerJuanJo Ciarlante <juanjosec@gmail.com>
Fri, 25 Mar 2011 12:30:29 +0000 (13:30 +0100)
  was incorrectly creating a PF_INET socket

socket.c

index 01c18e9c48aabecb362ca85082b452a6f3dbd07a..344c0dd260a9b538da72e04a6f43456d861c6c4a 100644 (file)
--- 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);