From: "cron2 (Code Review)" Date: Mon, 28 Jul 2025 10:35:40 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., antonio@...2726... Message-ID: <87b2822cbcf77de7083a810c1a24ed531ed233d4-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="CIryCEt094A="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: mudp.c, multi.c, multi_io.c: get rid of 'all three DCO platforms' #if... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --CIryCEt094A= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello flichtenheld, ordex, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1117?usp=3Demail to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review+2 by ordex Change subject: mudp.c, multi.c, multi_io.c: get rid of 'all three DCO plat= forms' #ifdefs ...................................................................... mudp.c, multi.c, multi_io.c: get rid of 'all three DCO platforms' #ifdefs With commit b66b80b2a all three platforms with DCO support have DCO float notifications now, so the #ifdef inside multi_process_incoming_dco() is no longer needed. Also, the whole notification block (process_incoming_del_peer() and multi_process_incoming_dco()) was surrounded by an #ifdef ENABLE_DCO "and all 3 platforms" which is also not making sense anymore (if we add a fourth DCO platform, we need to aim for having "all notifications from day 1", at least having the stubs and defines). Last not least, the event stuff in mudp.c and multi_io.c had grown the same construct - and we'll need events for any future DCO platform, too. So, fix those #ifdef as well, while at it. Change-Id: I6977d23b5289eba5db436608e0500216e0e689ec Signed-off-by: Gert Doering Acked-by: Antonio Quartulli Message-Id: <20250728084255.1824-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 377.html Signed-off-by: Gert Doering --- M src/openvpn/mudp.c M src/openvpn/multi.c M src/openvpn/multi_io.c 3 files changed, 5 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/17/1117/4 diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index ee8446a..118c954 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -412,8 +412,7 @@ multi_process_file_closed(m, mpp_flags); } #endif -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET= _WIN32)) +#if defined(ENABLE_DCO) else if (status & DCO_READ) { if (!IS_SIG(&m->top)) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 49f5320..b2d2b6c 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3337,8 +3337,7 @@ } #endif -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET= _WIN32)) +#if defined(ENABLE_DCO) static void process_incoming_del_peer(struct multi_context *m, struct multi_instance *= mi, dco_context_t *dco) @@ -3409,7 +3408,6 @@ { process_incoming_del_peer(m, mi, dco); } -#if defined(TARGET_LINUX) || defined(TARGET_WIN32) || defined(TARGET_FREEB= SD) else if (dco->dco_message_type =3D=3D OVPN_CMD_FLOAT_PEER) { ASSERT(mi->context.c2.link_sockets[0]); @@ -3419,7 +3417,6 @@ multi_process_float(m, mi, mi->context.c2.link_sockets[0]); CLEAR(dco->dco_float_peer_ss); } -#endif /* if defined(TARGET_LINUX) || defined(TARGET_WIN32) */ else if (dco->dco_message_type =3D=3D OVPN_CMD_SWAP_KEYS) { tls_session_soft_reset(mi->context.c2.tls_multi); @@ -3452,7 +3449,7 @@ dco->dco_write_bytes =3D 0; return ret > 0; } -#endif /* if defined(ENABLE_DCO) && defined(TARGET_LINUX) */ +#endif /* if defined(ENABLE_DCO) */ /* * Process packets in the TCP/UDP socket -> TUN/TAP interface direction, diff --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c index 4854f4b..102ee2f 100644 --- a/src/openvpn/multi_io.c +++ b/src/openvpn/multi_io.c @@ -191,8 +191,7 @@ } tun_set(m->top.c1.tuntap, m->multi_io->es, EVENT_READ, MULTI_IO_TUN, p= ersistent); -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET= _WIN32)) +#if defined(ENABLE_DCO) dco_event_set(&m->top.c1.tuntap->dco, m->multi_io->es, MULTI_IO_DCO); #endif @@ -526,8 +525,7 @@ multi_io_action(m, mi, TA_INITIAL, false); } } -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || define= d(TARGET_WIN32)) +#if defined(ENABLE_DCO) /* incoming data on DCO? */ else if (e->arg =3D=3D MULTI_IO_DCO) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1117?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: I6977d23b5289eba5db436608e0500216e0e689ec Gerrit-Change-Number: 1117 Gerrit-PatchSet: 4 Gerrit-Owner: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --CIryCEt094A= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #4 to this change.

View Change

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

mudp.c, multi.c, multi_io.c: get rid of 'all thr=
ee DCO platforms' #ifdefs

With commit b66b80b2a all three platfo= rms with DCO support have DCO float
notifications now, so the #ifdef ins= ide multi_process_incoming_dco() is
no longer needed.

Also, the w= hole notification block (process_incoming_del_peer() and
multi_process_i= ncoming_dco()) was surrounded by an

#ifdef ENABLE_DCO "and al= l 3 platforms"

which is also not making sense anymore (if we ad= d a fourth DCO platform,
we need to aim for having "all notificatio= ns from day 1", at least having
the stubs and defines).

Last= not least, the event stuff in mudp.c and multi_io.c had grown the
same = construct - and we'll need events for any future DCO platform, too.
=
So, fix those #ifdef as well, while at it.

Change-Id: I6977d23b5= 289eba5db436608e0500216e0e689ec
Signed-off-by: Gert Doering <gert@...493...= 1296...>
Acked-by: Antonio Quartulli <antonio@...2726...>
Me= ssage-Id: <20250728084255.1824-1-gert@...1296...>
URL: https://www= .mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32377.html
Sign= ed-off-by: Gert Doering <gert@...1296...>
---
M src/openvpn/mud= p.c
M src/openvpn/multi.c
M src/openvpn/multi_io.c
3 files changed= , 5 insertions(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.=
net:29418/openvpn refs/changes/17/1117/4
diff --git a/src/openvpn/m=
udp.c b/src/openvpn/mudp.c
index ee8446a..118c954 100644
--- a/src/openvpn/mudp.c
+++ b/src/openvpn/mu= dp.c
@@ -412,8 +412,7 @@
multi_pro= cess_file_closed(m, mpp_flags);
}
#en= dif
-#if defined(ENABLE= _DCO) \
- &&= (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32)= )
+#if defined(ENABLE= _DCO)
else if (status & DCO_READ)
= {
if (!IS_SIG(&m->top))
diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c

in= dex 49f5320..b2d2b6c 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -3337,8 +3337,7 @@<= /span>
}
#endif

-#if defined(ENABLE_DCO) \

= - && (defined(TARGET_L= INUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32))
+#if defined(ENABLE_DCO)
static void

process_incoming_del_peer(struct multi_co= ntext *m, struct multi_instance *mi,
= dco_context_t *dco)
@@ -3409,7 +3408,6 @@
{
process_incoming_del_peer(m, mi= , dco);
}
-#if defined(TARGET_LINUX) || defined(TARGET_WIN32) || defined(= TARGET_FREEBSD)
else if (dco->dco_message_type = =3D=3D OVPN_CMD_FLOAT_PEER)
{
= ASSERT(mi->context.c2.link_sockets[0]);
@@ -341= 9,7 +3417,6 @@
multi_process_float(m, mi, mi-&= gt;context.c2.link_sockets[0]);
CLEAR(dco->= dco_float_peer_ss);
}
-#endif /* if defined(TARGET_LINUX) || defined(TARG= ET_WIN32) */
else if (dco->dco_message_type =3D= =3D OVPN_CMD_SWAP_KEYS)
{
= tls_session_soft_reset(mi->context.c2.tls_multi);
@= @ -3452,7 +3449,7 @@
dco->dco_write_bytes =3D 0;

return ret > 0;
}
-#endif /* if defined(ENABLE_DCO) &&a= mp; defined(TARGET_LINUX) */
+#endif /* if defined(ENABLE_DCO) */

/*
* Process packets in the TCP/UDP socket -> TUN= /TAP interface direction,
diff --git a/src/openvpn/multi_io= .c b/src/openvpn/multi_io.c
index 4854f4b..102ee2f 100644
--- a/src/openvpn/multi_io.c
+++ b/src/openv= pn/multi_io.c
@@ -191,8 +191,7 @@
}


tun_set(m->top.c1.tuntap, m->mul= ti_io->es, EVENT_READ, MULTI_IO_TUN, persistent);
-#if defined(ENABLE_DCO) \
- && (defined(TARGET_LINUX) |= | defined(TARGET_FREEBSD) || defined(TARGET_WIN32))
+#if defined(ENABLE_DCO)
= dco_event_set(&m->top.c1.tuntap->dco, m->multi_io->es, = MULTI_IO_DCO);
#endif

@@= -526,8 +525,7 @@
multi_io_action(m, m= i, TA_INITIAL, false);
}
= }
-#if defi= ned(ENABLE_DCO) \
- = && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || def= ined(TARGET_WIN32))
+= #if defined(ENABLE_DCO)
/* incoming data on DC= O? */
else if (e->arg =3D=3D MULTI_IO_DCO)<= /span>
{

To view,= visit c= hange 1117. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6977d23b5289eba5db436608e05= 00216e0e689ec
Gerrit-Change-Number: 1117
Gerrit-PatchSet: 4
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--CIryCEt094A=--