From: "its_Giaan (Code Review)" Date: Wed, 9 Apr 2025 14:42:25 +0000 In-Reply-To: References: Reply-To: gianmarco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <97917fc53f7bf2c4f86fc41fab9a6e1f1fd3305b-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Bsc2gS5puMM="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix dco_win and multisocket interaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel , stipa --Bsc2gS5puMM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, its_Giaan, plaisthos. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/935?usp=3Demail to look at the new patch set (#2). Change subject: Fix dco_win and multisocket interaction ...................................................................... Fix dco_win and multisocket interaction Change-Id: I719b1aa2d2f4d63dc9c18d8e313fba339e3e4b0c Signed-off-by: Gianmarco De Gregori --- M src/openvpn/forward.c M src/openvpn/multi_io.c 2 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/35/935/2 diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index af1d008..4eaa4f2 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -2072,9 +2072,12 @@ /* * Calculate the flags based on the provided 'flags' argument. */ - if (flags & IOW_WAIT_SIGNAL) + if (c->options.mode !=3D MODE_SERVER) { - wait_signal(es, (void *)err_shift); + if (flags & IOW_WAIT_SIGNAL) + { + wait_signal(es, (void *)err_shift); + } } if (flags & IOW_TO_LINK) diff --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c index f1751ff..f2f40b0 100644 --- a/src/openvpn/multi_io.c +++ b/src/openvpn/multi_io.c @@ -176,10 +176,13 @@ int status, i; unsigned int *persistent =3D &m->multi_io->tun_rwflags; - for (i =3D 0; i < m->top.c1.link_sockets_num; i++) + if (!tuntap_is_dco_win(m->top.c1.tuntap)) { - socket_set_listen_persistent(m->top.c2.link_sockets[i], m->multi_i= o->es, - &m->top.c2.link_sockets[i]->ev_arg); + for (i =3D 0; i < m->top.c1.link_sockets_num; i++) + { + socket_set_listen_persistent(m->top.c2.link_sockets[i], m->mul= ti_io->es, + &m->top.c2.link_sockets[i]->ev_ar= g); + } } if (has_udp_in_local_list(&m->top.options)) @@ -202,7 +205,7 @@ } #endif tun_set(m->top.c1.tuntap, m->multi_io->es, EVENT_READ, MULTI_IO_TUN, p= ersistent); -#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) +#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN= 32) dco_event_set(&m->top.c1.tuntap->dco, m->multi_io->es, MULTI_IO_DCO); #endif @@ -535,7 +538,7 @@ multi_io_action(m, mi, TA_INITIAL, false); } } -#if defined(ENABLE_DCO) && (defined(TARGET_LINUX) || defined(TARGET_FREEBS= D)) +#if defined(ENABLE_DCO) && (defined(TARGET_LINUX) || defined(TARGET_FREEBS= D) || defined(TARGET_WIN32)) /* incoming data on DCO? */ else if (e->arg =3D=3D MULTI_IO_DCO) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/935?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: I719b1aa2d2f4d63dc9c18d8e313fba339e3e4b0c Gerrit-Change-Number: 935 Gerrit-PatchSet: 2 Gerrit-Owner: its_Giaan Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-CC: stipa Gerrit-Attention: plaisthos Gerrit-Attention: its_Giaan Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --Bsc2gS5puMM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, its_Giaan, plaistho= s.

its_Giaan uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/935?usp=3Demail">View Chang= e

Fix dco_win and multisocket interaction

Change-Id: I719b1aa2d2= f4d63dc9c18d8e313fba339e3e4b0c
Signed-off-by: Gianmarco De Gregori <g= ianmarco@...2726...>
---
M src/openvpn/forward.c
M src/openvpn/= multi_io.c
2 files changed, 13 insertions(+), 7 deletions(-)

g=
it pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/35/935/2
<= pre style=3D"font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c
index af1d008..4eaa4f2 100644
--- a/src/openvpn/forward.c=
+++ b/src/openvpn/forward.c
@@ -2072,9 +20= 72,12 @@
/*
* Calculate the flag= s based on the provided 'flags' argument.
*/<= /span>
- if (flags & IO= W_WAIT_SIGNAL)
+ i= f (c->options.mode !=3D MODE_SERVER)
{
- wait_signal(es, (void *)er= r_shift);

+ if= (flags & IOW_WAIT_SIGNAL)
+ {
= + wait_signal(es, (void *)err_shift);
+ }
}

if (flags & IOW_TO_LINK)
diff= --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c
in= dex f1751ff..f2f40b0 100644
--- a/src/openvpn/multi_io.c
+++ b/src/openvpn/multi_io.c
@@ -176,10 +176,= 13 @@
int status, i;
unsigned int= *persistent =3D &m->multi_io->tun_rwflags;

- for (i =3D 0; i < = m->top.c1.link_sockets_num; i++)
+ if (!tuntap_is_dco_win(m->top.c1.tuntap))
= {
- s= ocket_set_listen_persistent(m->top.c2.link_sockets[i], m->multi_io-&g= t;es,
- = &m->top.c2.link_sockets[i]->ev_arg);<= br>+ for (i =3D 0; i <= ; m->top.c1.link_sockets_num; i++)
+ {
+ socket_set_listen_persistent(m->top.c2.link_sockets[= i], m->multi_io->es,
+ &m->top.c2.link_sock= ets[i]->ev_arg);
+= }
}

if = (has_udp_in_local_list(&m->top.options))
@@ -202,7 += 205,7 @@
}
#endif
= tun_set(m->top.c1.tuntap, m->multi_io->es, EVENT_READ, MULTI_IO_= TUN, persistent);
-#if = defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
+#if defined(TARGET_LINUX) || defined(TARGET_FR= EEBSD) || defined(TARGET_WIN32)
dco_event_set(&m-&= gt;top.c1.tuntap->dco, m->multi_io->es, MULTI_IO_DCO);
<= span> #endif

@@ -535,7 +538,7 @@ multi_io_action(m, mi, TA_INITIAL, false);
}
}
-#if defined(ENABLE_DCO) &&= (defined(TARGET_LINUX) || defined(TARGET_FREEBSD))

+#if defined(ENABLE_DCO) && (defin= ed(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32))
/* incoming data on DCO? */
= else if (e->arg =3D=3D MULTI_IO_DCO)
= {

To view, visit change 935. To unsubscribe,= or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I719b1aa2d2f4d63dc9c18d8e313= fba339e3e4b0c
Gerrit-Change-Number: 935
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-CC: stipa <lstipakov@...277...> <= /div>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: its_Giaan <gianmarco@...1665...= 726...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--Bsc2gS5puMM=--