From: "its_Giaan (Code Review)" Date: Thu, 20 Nov 2025 10:57:50 +0000 In-Reply-To: References: Reply-To: gianmarco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., gert@...1296... Message-ID: <6d10a4c7fe809b1ac312ad034ef0f57434c80ed3-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="3tDdTmdJUuQ="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: multi-socket: do not return tuntap flags on server-side List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --3tDdTmdJUuQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld, its_Giaan, plais= thos. Hello cron2, flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by cron2 Change subject: multi-socket: do not return tuntap flags on server-side ...................................................................... multi-socket: do not return tuntap flags on server-side Tuntap flags are already handled within multi_io_process_io() so return them by multi_io_process_flags() would be redoundant, since we need them only for tun_set(). While at it, removed part of the I/O process from multi_process_io_udp() since those are also handled within multi_io_process_io(), and changed the IO debug to a more useful style. Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842 Signed-off-by: Gianmarco De Gregori --- M src/openvpn/forward.c M src/openvpn/mudp.c 2 files changed, 5 insertions(+), 71 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/2 diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index f01fb4c..d57cbe0 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -2170,10 +2170,10 @@ void get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, cons= t unsigned int flags) { - unsigned int out_socket, out_tuntap; + unsigned int out_socket; - multi_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tunta= p); - multi_io->udp_flags =3D out_socket | out_tuntap; + multi_io_process_flags(c, multi_io->es, flags, &out_socket, NULL); + multi_io->udp_flags =3D (out_socket << SOCKET_SHIFT); } void diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index 31134be..317c2dc 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -343,88 +343,22 @@ ? (MPP_CONDITIONAL_PRE_SELECT | MPP= _CLOSE_ON_SIGNAL) : (MPP_PRE_SELECT | MPP_CLOSE_ON_SI= GNAL); -#ifdef MULTI_DEBUG_EVENT_LOOP - char buf[16]; - buf[0] =3D 0; - if (status & SOCKET_READ) - { - strcat(buf, "SR/"); - } - else if (status & SOCKET_WRITE) - { - strcat(buf, "SW/"); - } - else if (status & TUN_READ) - { - strcat(buf, "TR/"); - } - else if (status & TUN_WRITE) - { - strcat(buf, "TW/"); - } - else if (status & FILE_CLOSED) - { - strcat(buf, "FC/"); - } - printf("IO %s\n", buf); -#endif /* ifdef MULTI_DEBUG_EVENT_LOOP */ - -#ifdef ENABLE_MANAGEMENT - if (status & (MANAGEMENT_READ | MANAGEMENT_WRITE)) - { - ASSERT(management); - management_io(management); - } -#endif - /* UDP port ready to accept write */ if (status & SOCKET_WRITE) { + dmsg(D_MULTI_DEBUG, "UDP socket write fd=3D" SOCKET_PRINTF, sock->= sd); multi_process_outgoing_link(m, mpp_flags); } - /* TUN device ready to accept write */ - else if (status & TUN_WRITE) - { - multi_process_outgoing_tun(m, mpp_flags); - } /* Incoming data on UDP port */ else if (status & SOCKET_READ) { + dmsg(D_MULTI_DEBUG, "UDP socket read fd=3D" SOCKET_PRINTF, sock->s= d); read_incoming_link(&m->top, sock); if (!IS_SIG(&m->top)) { multi_process_incoming_link(m, NULL, mpp_flags, sock); } } - /* Incoming data on TUN device */ - else if (status & TUN_READ) - { - read_incoming_tun(&m->top); - if (!IS_SIG(&m->top)) - { - multi_process_incoming_tun(m, mpp_flags); - } - } -#ifdef ENABLE_ASYNC_PUSH - /* INOTIFY callback */ - else if (status & FILE_CLOSED) - { - multi_process_file_closed(m, mpp_flags); - } -#endif -#if defined(ENABLE_DCO) - else if (status & DCO_READ) - { - if (!IS_SIG(&m->top)) - { - bool ret =3D true; - while (ret) - { - ret =3D multi_process_incoming_dco(m); - } - } - } -#endif m->multi_io->udp_flags =3D ES_ERROR; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1364?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842 Gerrit-Change-Number: 1364 Gerrit-PatchSet: 2 Gerrit-Owner: its_Giaan Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: its_Giaan Gerrit-Attention: flichtenheld --3tDdTmdJUuQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: cron2, flichtenheld, its_Giaan, plaisthos.

its_Giaan uploaded patch set #2 to this change.

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

The following approvals got outdated and were removed: Code-Review-1 by cron2

multi-socket: do not return tuntap =
flags on server-side

Tuntap flags are already handled within
mult= i_io_process_io() so return them by
multi_io_process_flags() would be re= doundant,
since we need them only for tun_set().

While at it, rem= oved part of the I/O process
from multi_process_io_udp() since those are=
also handled within multi_io_process_io(),
and changed the IO debug = to a more useful
style.

Change-Id: I6a5110a0583b8b33496b06d9c27c1= 084df38e842
Signed-off-by: Gianmarco De Gregori <gianmarco@...2726...= >
---
M src/openvpn/forward.c
M src/openvpn/mudp.c
2 files c= hanged, 5 insertions(+), 71 deletions(-)

git pul=
l ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/2
dif=
f --git a/src/openvpn/forward.c b/src/openvpn/forward.c
ind= ex f01fb4c..d57cbe0 100644
--- a/src/openvpn/forward.c
+++ b/src/openvpn/forward.c
@@ -2170,10 +2170,1= 0 @@
void
get_io_flags_dowork_udp(struct = context *c, struct multi_io *multi_io, const unsigned int flags)
= {
- unsigned = int out_socket, out_tuntap;
+ unsigned int out_socket;

- multi_io_process_flags(c, multi_io->= ;es, flags, &out_socket, &out_tuntap);
- multi_io->udp_flags =3D out_socket | out_tu= ntap;
+ multi_io_p= rocess_flags(c, multi_io->es, flags, &out_socket, NULL);
<= span style=3D"color: hsl(120, 100%, 40%);">+ multi_io->udp_flags =3D = (out_socket << SOCKET_SHIFT);

}

void
diff --git a/src/openvpn/mudp.c b/src/o= penvpn/mudp.c
index 31134be..317c2dc 100644
--- a/src/openvpn/mudp.c

+++ b/src/openvpn/mudp.c@@ -343,88 +343,22 @@
= ? (MPP_CONDITIONAL_PRE_SELECT | MPP_CLOSE_ON_SIGNAL)
<= span> : (MPP_PRE_SELECT | MPP_CLOSE_= ON_SIGNAL);

-#ifdef MULTI_DEBUG_EVENT_LOOP
- char buf[16];
- buf[0] =3D 0;
- if (status & SOCKET_READ)
- {
- strcat(buf, "SR/");
- }
- else if (status & SOCKET_WRITE)
- {
- strcat(buf, "SW/");
- }
- else if (status & TUN_READ)
- {
- strcat(buf, "TR/");
- }
- else if (status & TUN_WRITE)
- {
- }
- {
- strcat(buf, "FC/");
- }
- printf("IO %s\n", buf);
-#endif /* ifdef MULTI_DEBUG_EVENT_LOOP */
-
-#ifdef ENABLE_MANAGEMENT
- if (status & (MANAGEMENT_READ | MANAGEMENT_WR= ITE))
- {
= - ASSERT(management);
- management_io(mana= gement);
- }<= br>-#endif
-
/* UDP port ready to = accept write */
if (status & SOCKET_WRITE)<= br> {
+ = dmsg(D_MULTI_DEBUG, "UDP socket write fd=3D" SOCKET_PRINTF, s= ock->sd);
multi_process_outgoing_link(m, mpp_fl= ags);
}
- /* TUN device ready to accept write */
- else if (status & TUN_WRITE)
= - {
- multi_process_outgoing_tun(m, mpp_flags)= ;
- }
/* Incoming data on UDP port */

else if (status= & SOCKET_READ)
{
+ dmsg(D_MULTI_DEBUG, "UDP socket read fd= =3D" SOCKET_PRINTF, sock->sd);
read_incomi= ng_link(&m->top, sock);
if (!IS_SIG(&m-= >top))
{
multi_pro= cess_incoming_link(m, NULL, mpp_flags, sock);
}
}
- = /* Incoming data on TUN device */
- else if (status & TUN_READ)
- {
- read_incoming_tun(&m->top);
- if (!IS_SIG(&m->top))
- {
- multi_process_incoming_tun= (m, mpp_flags);
- = }
- }
-#ifdef ENABLE_ASYNC_PUSH
- /* INOTIFY callback */
- else if (status & = FILE_CLOSED)
- {

- multi_process_fil= e_closed(m, mpp_flags);
- }
-#endif<= br>-#if defined(ENABLE_DCO)
- else if (status & D= CO_READ)
- {<= br>- if (!IS_SIG(&m-&g= t;top))
- {
- bool ret =3D t= rue;
- while= (ret)
- {
- ret =3D= multi_process_incoming_dco(m);
- }
- }
- }
-#endif

m->multi_io->udp_flags =3D ES_ERROR;
}


To view, visit change 1364. To unsub= scribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a5110a0583b8b33496b06d9c27= c1084df38e842
Gerrit-Change-Number: 1364
Gerrit-PatchSet: 2
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
Gerrit-Reviewer: cron2 <gert@...1296...>=
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: cron2 <gert@...1296...>= ;
Gerrit-Attention: its_Giaan <gianmarco@...1665...= 726...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --3tDdTmdJUuQ=--