| Message ID | 20250325105724.1285-1-gert@greenie.muc.de |
|---|---|
| State | Accepted |
| Headers | show |
| Series | [Openvpn-devel,v1] socket: use remote proto when creating client sockets | expand |
Yeah, too many protos around... Arne and Lev confirm that this is what
is needed to un-confuse "--local <with proto>" and "--remote <with proto>"
and general "--<proto>" (--udp4 etc) for the client case...
Tested with standard and extended t_client test set (extended = one
stanza that has multiple --remote with different protos *and* --local
bound to a local IP).
There's a number of interesting ways to break things here
("--local ipv4 --remote ipv6 --proto udp6") but that's all clear
misconfigs - these have never worked, it's just that the error messages
are bit different with multisocket. "--local $hostname" with something
that resolves to both an ipv4 and ipv6 address nicely binds to whatever
the "--remote" stanza tries to use (v4/v6). Good.
Your patch has been applied to the master branch.
commit 39cd7f29cbccd37b07ddc27eb23b8ad270f43e77
Author: Antonio Quartulli
Date: Tue Mar 25 11:57:24 2025 +0100
socket: use remote proto when creating client sockets
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>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 6b32e30..ad97830 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1886,6 +1886,11 @@ 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;