From: "cron2 (Code Review)" Date: Fri, 7 Nov 2025 16:32:11 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="YovYQDDVM60="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: FreeBSD DCO: repair incoming 'delete peer' notifications in p2p clien... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: flichtenheld , plaisthos , openvpn-devel --YovYQDDVM60= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/13= 53?usp=3Demail ) Change subject: FreeBSD DCO: repair incoming 'delete peer' notifications in= p2p client mode ...................................................................... FreeBSD DCO: repair incoming 'delete peer' notifications in p2p client mode commit 4a48841da2 introduced a workaround for spurious DCO notifications "with no useful content" on Linux - namely, ignoring dco_message_type=3D=3D0 in forward.c, process_incoming_dco(), "because Linux has no message type 0 anyway". Each DCO platform uses its own enum for these notification messages *inside* OpenVPN (which might not have the best design decision ever), and FreeBSD had OVPN_CMD_DEL_PEER in the enum on "position 0"... Fix by changing the enum to start with 1. Tested with DEL_PEER in p2p client and DEL_PEER & FLOAT in p2mp server mode. v2: introduce OVPN_CMD_NO_MESSAGE in position 0, and a comment explaining why. A future commit can then clean up forward.c and dco_linux.c to use the constant, and not "magic 0 which happens to be in there after CLEAR()". Github: fixes OpenVPN/openvpn#881 Change-Id: I991d6053776efed771bc1a3880acb80b55959cbc Signed-off-by: Gert Doering Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1353 Message-Id: <20251107141333.12056-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 237.html Signed-off-by: Gert Doering --- M src/openvpn/dco_freebsd.h 1 file changed, 2 insertions(+), 0 deletions(-) diff --git a/src/openvpn/dco_freebsd.h b/src/openvpn/dco_freebsd.h index 0797b82..5e2a552 100644 --- a/src/openvpn/dco_freebsd.h +++ b/src/openvpn/dco_freebsd.h @@ -33,6 +33,8 @@ enum ovpn_message_type_t { + /* message type #0 is treated as magic number by process_incoming_dco(= ) */ + OVPN_CMD_NO_MESSAGE =3D 0, OVPN_CMD_DEL_PEER, OVPN_CMD_PACKET, OVPN_CMD_SWAP_KEYS, -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1353?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I991d6053776efed771bc1a3880acb80b55959cbc Gerrit-Change-Number: 1353 Gerrit-PatchSet: 4 Gerrit-Owner: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --YovYQDDVM60= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

FreeBSD DCO: repair incoming 'delete peer=
9; notifications in p2p client mode

commit 4a48841da2 introduced a w= orkaround for spurious DCO notifications
"with no useful content&qu= ot; on Linux - namely, ignoring dco_message_type=3D=3D0
in forward.c, pr= ocess_incoming_dco(), "because Linux has no message
type 0 anyway&q= uot;.

Each DCO platform uses its own enum for these notification mes= sages
*inside* OpenVPN (which might not have the best design decision ev= er),
and FreeBSD had OVPN_CMD_DEL_PEER in the enum on "position 0&q= uot;...

Fix by changing the enum to start with 1. Tested with DEL_P= EER in p2p
client and DEL_PEER & FLOAT in p2mp server mode.

v= 2:
introduce OVPN_CMD_NO_MESSAGE in position 0, and a comment explaini= ng why.
A future commit can then clean up forward.c and dco_linux.c to= use the
constant, and not "magic 0 which happens to be in there = after CLEAR()".

Github: fixes OpenVPN/openvpn#881

Change= -Id: I991d6053776efed771bc1a3880acb80b55959cbc
Signed-off-by: Gert Doeri= ng <gert@...1296...>
Acked-by: Frank Lichtenheld <frank@...2746...= ...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1353
Messa= ge-Id: <20251107141333.12056-1-gert@...1296...>
URL: https://www.m= ail-archive.com/openvpn-devel@lists.sourceforge.net/msg34237.html
Signed= -off-by: Gert Doering <gert@...1296...>
---
M src/openvpn/dco_f= reebsd.h
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/openvpn/dco_freebsd.h b/src/openvpn/dco_freebsd.h
index 0797b82..5e2a552 100644
--- a/src/openvpn/= dco_freebsd.h
+++ b/src/openvpn/dco_freebsd.h
@@ -33,6 +33,8 @@

enum ovpn_message_t= ype_t
{
+ /* message type #0 is treated as magic number by process_incoming_= dco() */
+ OVPN_CM= D_NO_MESSAGE =3D 0,
OVPN_CMD_DEL_PEER,
OVPN_CMD_PACKET,
OVPN_CMD_SWAP_KEYS,
<= span>

To view, visit change 1353. To unsubscribe, or for hel= p writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I991d6053776efed771bc1a3880a= cb80b55959cbc
Gerrit-Change-Number: 1353
Gerrit-PatchSet: 4
Gerrit-Owner: 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>
= --YovYQDDVM60=--