From: "cron2 (Code Review)" Date: Mon, 24 Nov 2025 18:50:01 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <5a41f3c5388989b2770fd13c489aeeb0326f97b4-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="3RH8ot7B10c="; 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: its_Giaan , plaisthos , flichtenheld Cc: openvpn-devel --3RH8ot7B10c= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/1364?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 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(), removed the FILE_CLOSED and FILE_SHIFT defines since we now handle that kind of event in multi_io_process_io() through the MULTI_IO_FILE_CLOSE_WRITE define. Change-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842 Signed-off-by: Gianmarco De Gregori Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1364 Message-Id: <20251124175832.21352-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 650.html Signed-off-by: Gert Doering --- M src/openvpn/event.h M src/openvpn/forward.c M src/openvpn/mudp.c 3 files changed, 4 insertions(+), 74 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/4 diff --git a/src/openvpn/event.h b/src/openvpn/event.h index f6aa9c4..c2c63f6 100644 --- a/src/openvpn/event.h +++ b/src/openvpn/event.h @@ -68,8 +68,6 @@ #define MANAGEMENT_SHIFT 6 #define MANAGEMENT_READ (1 << (MANAGEMENT_SHIFT + READ_SHIFT)) #define MANAGEMENT_WRITE (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT)) -#define FILE_SHIFT 8 -#define FILE_CLOSED (1 << (FILE_SHIFT + READ_SHIFT)) #define DCO_SHIFT 10 #define DCO_READ (1 << (DCO_SHIFT + READ_SHIFT)) #define DCO_WRITE (1 << (DCO_SHIFT + WRITE_SHIFT)) diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index a6d3394..ccb8404 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..b03e165 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -333,7 +333,7 @@ } /* - * Process an I/O event. + * Process a UDP socket event. */ void multi_process_io_udp(struct multi_context *m, struct link_socket *sock) @@ -343,50 +343,11 @@ ? (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) { 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) { @@ -396,35 +357,6 @@ 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: 4 Gerrit-Owner: its_Giaan Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --3RH8ot7B10c= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #4 to the change originally created by its_Giaan.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+2 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(),
removed the FILE_CLOSED a= nd FILE_SHIFT
defines since we now handle that kind of
event in multi= _io_process_io() through
the MULTI_IO_FILE_CLOSE_WRITE define.

Ch= ange-Id: I6a5110a0583b8b33496b06d9c27c1084df38e842
Signed-off-by: Gianma= rco De Gregori <gianmarco@...2726...>
Acked-by: Gert Doering <g= ert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/13= 64
Message-Id: <20251124175832.21352-1-gert@...1296...>
URL: ht= tps://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34650.htm= l
Signed-off-by: Gert Doering <gert@...1296...>
---
M src/op= envpn/event.h
M src/openvpn/forward.c
M src/openvpn/mudp.c
3 files= changed, 4 insertions(+), 74 deletions(-)

git p=
ull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1364/4
d= iff --git a/src/openvpn/event.h b/src/openvpn/event.h
index= f6aa9c4..c2c63f6 100644
--- a/src/openvpn/event.h+++ b/src/openvpn/event.h
@@ -68,8 +68,6 @@<= br> #define MANAGEMENT_SHIFT 6
#define MANAGEMENT_RE= AD (1 << (MANAGEMENT_SHIFT + READ_SHIFT))
#define M= ANAGEMENT_WRITE (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT))
-#define FILE_SHIFT 8-#define FILE_CLOSED (1 &l= t;< (FILE_SHIFT + READ_SHIFT))
#define DCO_SHIFT = 10
#define DCO_READ (1 << (DCO_SHIFT + READ= _SHIFT))
#define DCO_WRITE (1 << (DCO_SHIFT += WRITE_SHIFT))
diff --git a/src/openvpn/forward.c b/src/ope= nvpn/forward.c
index a6d3394..ccb8404 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, co= nst unsigned int flags)

{
- unsigned int out_socket, out_tuntap;
+ unsigned int out_socket;


- mult= i_io_process_flags(c, multi_io->es, flags, &out_socket, &out_tun= tap);
- multi_io->= ;udp_flags =3D out_socket | out_tuntap;
+ multi_io_process_flags(c, multi_io->es, flags, &= amp;out_socket, NULL);
- * Process an I/O event.
+ * Process a UDP socket event.
= */
void
multi_process_io_udp(struct mult= i_context *m, struct link_socket *sock)
@@ -343,50 +343,11 = @@
? (MPP_CONDITION= AL_PRE_SELECT | MPP_CLOSE_ON_SIGNAL)
= : (MPP_PRE_SELECT | MPP_CLOSE_ON_SIGNAL);

-#ifdef MULTI_DEBUG_= EVENT_LOOP
- char bu= f[16];
- buf[0] =3D = 0;
- if (status &= ; SOCKET_READ)
- {
- strcat(buf, &qu= ot;SR/");
- }
- else if (status &am= p; SOCKET_WRITE)
- {=
- strcat(buf, &= quot;SW/");
- }=
- else if (status &= amp; TUN_READ)
- {
- strcat(buf, &qu= ot;TR/");
- }
- else if (status &am= p; TUN_WRITE)
- {
- strcat(buf, &quo= t;TW/");
- }
- else if (status &= ; FILE_CLOSED)
- {
- strcat(buf, &qu= ot;FC/");
- }
- printf("IO %s\= n", buf);
-#endif = /* ifdef MULTI_DEBUG_EVENT_LOOP */
-
-#ifdef E= NABLE_MANAGEMENT
- i= f (status & (MANAGEMENT_READ | MANAGEMENT_WRITE))
- {
- ASSERT(management);
- management_io(management);
- }
-#endif
-
/* UDP port ready to accept write */
if (status & SOCKET_WRITE)

{
multi_process_outgoing_link(m, mpp_flags);

= }
- /* TUN device = ready to accept write */
- {
- multi_process_outgoing_tun(m, mpp_flags);
- }
/* Incoming data= on UDP port */
else if (status & SOCKET_READ)

{
@@ -396,35 +357,6 @@
= 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(&= amp;m->top))
- = {
- multi_= process_incoming_tun(m, mpp_flags);
- }
- }
-#ifdef ENABLE_= ASYNC_PUSH
- /* INOT= IFY callback */
- el= se if (status & FILE_CLOSED)
- {
- = multi_process_file_closed(m, mpp_flags);
- }
-#endif
-#if defin= ed(ENABLE_DCO)
- els= e if (status & DCO_READ)
- {
- i= f (!IS_SIG(&m->top))
- {
- = bool ret =3D true;
- {
- = ret =3D multi_process_incoming_dco(m);
- }
- }
- }
-#end= if

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

To view, v= isit cha= nge 1364. To unsubscribe, 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: 4
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>
= --3RH8ot7B10c=--