]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
socket: use remote proto when creating client sockets
authorAntonio Quartulli <antonio@mandelbit.com>
Tue, 25 Mar 2025 10:57:24 +0000 (11:57 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 1 Apr 2025 13:24:11 +0000 (15:24 +0200)
When creating a socket to connect to a remote (this happens
in client mode) always use the protocol specified for the
remote.

The listening protocol in this case is just ignored as it
does not make any sense.

Change-Id: I6d2ec69ac7a9ef5900d8f1d8541d6a19c9cb7df9
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20250325105724.1285-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31234.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/socket.c

index 09de1b0b02496bb233ee444773ef04f8b0a4cc91..4fb6fe6c365aea607b4994f73d3babc3ebf2bca7 100644 (file)
@@ -1903,6 +1903,11 @@ link_socket_init_phase1(struct context *c, int sock_index, int mode)
     const char *remote_host = o->ce.remote;
     const char *remote_port = o->ce.remote_port;
 
+    if (remote_host)
+    {
+        proto = o->ce.proto;
+    }
+
     if (c->mode == CM_CHILD_TCP || c->mode == CM_CHILD_UDP)
     {
         struct link_socket *tmp_sock = NULL;