From: "cron2 (Code Review)" Date: Wed, 2 Apr 2025 18:32:17 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <73403bafe5829c8c182485c0cf67002cd5b4ddbe-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="e9sZzutzje4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix FreeBSD-DCO and Multisocket interaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: its_Giaan , plaisthos , flichtenheld Cc: openvpn-devel --e9sZzutzje4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/925?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Fix FreeBSD-DCO and Multisocket interaction ...................................................................... Fix FreeBSD-DCO and Multisocket interaction FreeBSD-DCO does not support TCP as transport protocol so in order to be able to use DCO in a multi-socket environment we need to check the local_list entries and disable DCO if any of the listening socket is TCP. While at it, removed some dead code left from Multisocket polishing. Github: closes OpenVPN/openvpn#710 Change-Id: I9b6359076a61ae2bbb8e5cea00e33969cb5f92cf Signed-off-by: Gianmarco De Gregori Acked-by: Gert Doering Message-Id: <20250402132148.18810-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 324.html Signed-off-by: Gert Doering --- M src/openvpn/dco.c M src/openvpn/options.c M src/openvpn/options.h 3 files changed, 9 insertions(+), 22 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/25/925/2 diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index d00958d..7ad9cb3 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -260,10 +260,16 @@ } #if defined(TARGET_FREEBSD) - if (!proto_is_udp(ce->proto)) + if (ce->local_list) { - msg(msglevel, "NOTE: TCP transport disables data channel offload o= n FreeBSD."); - return false; + for (int i =3D 0; i < ce->local_list->len; i++) + { + if (!proto_is_dgram(ce->local_list->array[i]->proto)) + { + msg(msglevel, "NOTE: TCP transport disables data channel o= ffload on FreeBSD."); + return false; + } + } } #endif diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 99dd60a..6605a42 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -9577,20 +9577,3 @@ return false; } - -bool -has_tcp_in_local_list(const struct options *options) -{ - if (options->ce.local_list) - { - for (int i =3D 0; i < options->ce.local_list->len; i++) - { - if (!proto_is_dgram(options->ce.local_list->array[i]->proto)) - { - return true; - } - } - } - - return false; -} diff --git a/src/openvpn/options.h b/src/openvpn/options.h index fa617c8..8d1ef6c 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -921,8 +921,6 @@ bool has_udp_in_local_list(const struct options *options); -bool has_tcp_in_local_list(const struct options *options); - /** * Returns whether the current configuration has dco enabled. */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/925?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: I9b6359076a61ae2bbb8e5cea00e33969cb5f92cf Gerrit-Change-Number: 925 Gerrit-PatchSet: 2 Gerrit-Owner: its_Giaan Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --e9sZzutzje4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by its_Giaan.

View Change

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

Fix FreeBSD-DCO and Multisocket interaction

F= reeBSD-DCO does not support TCP as transport protocol so in order to
be = able to use DCO in a multi-socket environment we need to check the
local= _list entries and disable DCO if any of the listening socket
is TCP.
=
While at it, removed some dead code left from Multisocket polishing.
Github: closes OpenVPN/openvpn#710

Change-Id: I9b6359076a61ae2b= bb8e5cea00e33969cb5f92cf
Signed-off-by: Gianmarco De Gregori <gianmar= co@...2726...>
Acked-by: Gert Doering <gert@...1296...>
Mess= age-Id: <20250402132148.18810-1-gert@...1296...>
URL: https://www.= mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31324.html
Signe= d-off-by: Gert Doering <gert@...1296...>
---
M src/openvpn/dco.= c
M src/openvpn/options.c
M src/openvpn/options.h
3 files changed,= 9 insertions(+), 22 deletions(-)

git pull ssh://gerrit.openvpn.n=
et:29418/openvpn refs/changes/25/925/2
diff --git a/src/openvpn/dco=
.c b/src/openvpn/dco.c
index d00958d..7ad9cb3 100644=
--- a/src/openvpn/dco.c
+++ b/src/openvpn/dco.c
@@ -260,10 +260,16 @@
}

#if defined(TARGET_FREEBSD)
- if (!proto_is_udp(ce->proto))
+ if (ce->local_list)
{
- = msg(msglevel, "NOTE: TCP transport disables data channel offload o= n FreeBSD.");
- = return false;
+ = for (int i =3D 0; i < ce->local_list->len; i++)
<= span style=3D"color: hsl(120, 100%, 40%);">+ {
+ if (!proto_is_dgram(ce->lo= cal_list->array[i]->proto))
+ {
+ msg(msglevel, "NOTE: TCP transport disables da= ta channel offload on FreeBSD.");
+ return false;
+ }
+ }
}
#e= ndif

diff --git a/src/openvpn/options.c b= /src/openvpn/options.c
index 99dd60a..6605a42 100644=
--- a/src/openvpn/options.c
+++ b/src/openvpn/opt= ions.c
@@ -9577,20 +9577,3 @@

<= span> return false;
}
-
-= bool
-has_tcp_in_local_= list(const struct options *options)
-{
- if= (options->ce.local_list)
- {
- f= or (int i =3D 0; i < options->ce.local_list->len; i++)
<= span style=3D"color: hsl(0, 100%, 40%);">- {
- if (!proto_is_dgram(options->= ;ce.local_list->array[i]->proto))
- {
- return true;
- }
- }
- = }
-
- return false;
-}
diff --git a/src/openvpn/= options.h b/src/openvpn/options.h
index fa617c8..8d1ef6c 10= 0644
--- a/src/openvpn/options.h
+++ b/src/= openvpn/options.h
@@ -921,8 +921,6 @@

bool has_udp_in_local_list(const struct options *options);


-bool h= as_tcp_in_local_list(const struct options *options);
-
/**
* R= eturns whether the current configuration has dco enabled.
= */

To view, visit change 925. To unsubscrib= e, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9b6359076a61ae2bbb8e5cea00e= 33969cb5f92cf
Gerrit-Change-Number: 925
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-MessageType: newpatchset
--e9sZzutzje4=--