[XS] Change in openvpn[master]: Fix: port-share and multi-socket interaction

"cron2 \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <f683a4c292f70df0fb0bca4f75b574635ce9011d-EmailReplacePatchSet-HTML@gerrit.openvpn.net>
cron2 has uploaded a new patch set (#2) to the change originally created by its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/1680?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Fix: port-share and multi-socket interaction
......................................................................

Fix: port-share and multi-socket interaction

When port-share is used, enforce the presence
of a TCP listener by checking the local_list
entries insted of rely on the global
connection_entry proto field.

Github: fixes OpenVPN/openvpn#1027

Change-Id: Id4e21efebbe64b963cf7847ad77bc41339af7a37
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]>
---
M src/openvpn/options.c
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/80/1680/2

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 128d1e5..62c0bbb 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -2490,8 +2490,13 @@
             msg(M_USAGE, USAGE_VALID_SERVER_PROTOS);
         }
 #if PORT_SHARE
+        bool has_tcp = false;
+        for (int i = 0; i < ce->local_list->len && !has_tcp; i++)
+        {
+            has_tcp = (ce->local_list->array[i]->proto == PROTO_TCP_SERVER);
+        }
         if ((options->port_share_host || options->port_share_port)
-            && (ce->proto != PROTO_TCP_SERVER))
+            && !has_tcp)
         {
             msg(M_USAGE, "--port-share only works in TCP server mode "
                          "(--proto values of tcp-server, tcp4-server, or tcp6-server)");

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1680?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id4e21efebbe64b963cf7847ad77bc41339af7a37
Gerrit-Change-Number: 1680
Gerrit-PatchSet: 2
Gerrit-Owner: its_Giaan <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.