From: "its_Giaan (Code Review)" Date: Thu, 11 Sep 2025 14:08:24 +0000 In-Reply-To: References: Reply-To: gianmarco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="3HzMfWsYW1o="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Multi-socket win: avoid repeated socket_set() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --3HzMfWsYW1o= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1174?usp=3Demail to look at the new patch set (#2). Change subject: Multi-socket win: avoid repeated socket_set() ...................................................................... Multi-socket win: avoid repeated socket_set() On Windows, multi-socket support failed with mixed protocols due to repeated socket_set() calls, which caused accept() to be triggered before having an event to process. This fix skips socket_set() calls for non-UDP sockets in MODE_SERVER inside multi_io_process_flags(). Change-Id: Ia389fcec50fb2bbc0aa5ad41a2c23c17c04e6e9b Signed-off-by: Gianmarco De Gregori --- M src/openvpn/forward.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/74/1174/2 diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 03b6a0c..1552d39 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -2124,7 +2124,10 @@ */ for (int i =3D 0; i < c->c1.link_sockets_num; i++) { - socket_set(c->c2.link_sockets[i], es, socket, &c->c2.link_sockets[= i]->ev_arg, NULL); + if ((c->options.mode !=3D MODE_SERVER) || (proto_is_dgram(c->c2.li= nk_sockets[i]->info.proto))) + { + socket_set(c->c2.link_sockets[i], es, socket, &c->c2.link_sock= ets[i]->ev_arg, NULL); + } } tun_set(c->c1.tuntap, es, tuntap, (void *)tun_shift, NULL); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1174?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ia389fcec50fb2bbc0aa5ad41a2c23c17c04e6e9b Gerrit-Change-Number: 1174 Gerrit-PatchSet: 2 Gerrit-Owner: its_Giaan Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --3HzMfWsYW1o= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

its_Giaan uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/1174?usp=3Demail">View Chan= ge

Multi-socket win: avoid repeated socket_set()

On Windows, mul= ti-socket support failed with
mixed protocols due to repeated socket_set= ()
calls, which caused accept() to be triggered
before having an even= t to process.
This fix skips socket_set() calls for
non-UDP sockets i= n MODE_SERVER inside
multi_io_process_flags().

Change-Id: Ia389fc= ec50fb2bbc0aa5ad41a2c23c17c04e6e9b
Signed-off-by: Gianmarco De Gregori &= lt;gianmarco@...2726...>
---
M src/openvpn/forward.c
1 file cha= nged, 4 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvp=
n.net:29418/openvpn refs/changes/74/1174/2
diff --git a/src/openvpn=
/forward.c b/src/openvpn/forward.c
index 03b6a0c..1552d39 1= 00644
--- a/src/openvpn/forward.c
+++ b/src= /openvpn/forward.c
@@ -2124,7 +2124,10 @@
= */
for (int i =3D 0; i < c->c1.link_sockets= _num; i++)
{
- socket_set(c->c2.link_sockets[i], es, socket, &c= ->c2.link_sockets[i]->ev_arg, NULL);
+ if ((c->options.mode !=3D MODE_SERVER) ||= (proto_is_dgram(c->c2.link_sockets[i]->info.proto)))
+ {
+ socket_set(c->c2.link_sockets[= i], es, socket, &c->c2.link_sockets[i]->ev_arg, NULL);
= + }
= }

tun_set(c->c1.tuntap, es, tunt= ap, (void *)tun_shift, NULL);

To view, = visit ch= ange 1174. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia389fcec50fb2bbc0aa5ad41a2c= 23c17c04e6e9b
Gerrit-Change-Number: 1174
Gerrit-PatchSet: 2
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--3HzMfWsYW1o=--