diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index 6b32e30..808870b 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -1724,9 +1724,17 @@
                 gai_strerror(status));
         }
 
-        /* the resolved 'local entry' might have a different family than what
-         * was globally configured */
-        sock->info.af = sock->info.lsa->bind_local->ai_family;
+        /* the resolved family makes sense only if the host is not ANY,
+         * otherwise getaddrinfo() may return v4 and break connections
+         * to v6 only remotes
+         */
+        if (sock->local_host)
+        {
+            /* the resolved 'local entry' might have a different family than
+             * what was globally configured
+             */
+            sock->info.af = sock->info.lsa->bind_local->ai_family;
+        }
     }
 
     gc_free(&gc);
