Tested this on master without the patch.  A config with two "local"
statements, one UDP, one TCP, and "port-share" will always fail with

   Jun  9 10:26:19 gentoo tun-tcp-p2mp[19994]: Options error: --port-share only 
works in TCP server mode (--proto values of tcp-server, tcp4-server, or 
tcp6-server)

(the order of "local" statements does not matter).  With the patch, it
will happily bind both ports and portshare works...

   2026-06-09 10:36:17 us=623614 
tcp6-server:[2001:608:4:0:62e9:965e:fba9:3fef]:50046 Non-OpenVPN client 
protocol detected

The code change is also quite straightforward - instead of checking only
"ce->proto" (which might be anything here), we need to walk list of
sockets and see if there is "any tcp socket".  I also tested "2 TCP 
sockets", and port-share works on either of them.  Good :-)


Your patch has been applied to the master and release/2.7 branch (bugfix).

commit 0d7ea983e4c92d4c2caf5077ed8e868744c72512 (master)
commit 06e71f0c5fb3e8bc5980ca10e062b0c571b9b071 (release/2.7)
Author: Gianmarco De Gregori
Date:   Wed May 20 12:11:44 2026 +0200

     Fix: port-share and multi-socket interaction

     Signed-off-by: Gianmarco De Gregori <[email protected]>
     Acked-by: Frank Lichtenheld <[email protected]>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1680
     Message-Id: <[email protected]>
     URL: 
https://www.mail-archive.com/[email protected]/msg36986.html
     Signed-off-by: Gert Doering <[email protected]>


--
kind regards,

Gert Doering



_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to