From: "cron2 (Code Review)" Date: Thu, 16 Oct 2025 10:47:00 +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="lB1s0pwl0o8="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: init: Fix datav2_enabled check in options import List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --lB1s0pwl0o8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/12= 73?usp=3Demail ) Change subject: init: Fix datav2_enabled check in options import ...................................................................... init: Fix datav2_enabled check in options import peer_id is unsigned, so the previous check was partly useless. Instead check use_peer_id. Change-Id: Ia713a2ecfcad7032863867630a0c306ff9f90385 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1273 Message-Id: <20251016103308.4685-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33= 365.html Signed-off-by: Gert Doering --- M src/openvpn/init.c 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index aaa0573..aa2611d 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -2728,8 +2728,8 @@ /* Ensure that for epoch data format is only enabled if also data v2 * is enabled */ - bool epoch_data =3D (c->options.imported_protocol_flags & CO_EPOCH_DAT= A_KEY_FORMAT); - bool datav2_enabled =3D (c->options.peer_id >=3D 0 && c->options.peer_= id < MAX_PEER_ID); + bool epoch_data =3D c->options.imported_protocol_flags & CO_EPOCH_DATA= _KEY_FORMAT; + bool datav2_enabled =3D c->options.use_peer_id && c->options.peer_id <= MAX_PEER_ID; if (epoch_data && !datav2_enabled) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1273?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: Ia713a2ecfcad7032863867630a0c306ff9f90385 Gerrit-Change-Number: 1273 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --lB1s0pwl0o8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

init: Fix datav2_enabled check in options import=


peer_id is unsigned, so the previous check was partly
useless. I= nstead check use_peer_id.

Change-Id: Ia713a2ecfcad7032863867630a0c30= 6ff9f90385
Signed-off-by: Frank Lichtenheld <frank@...2641...>
= Acked-by: Arne Schwabe <arne-openvpn@...1227...>
Gerrit URL: https= ://gerrit.openvpn.net/c/openvpn/+/1273
Message-Id: <20251016103308.46= 85-1-gert@...1296...>
URL: https://www.mail-archive.com/openvpn-devel= @lists.sourceforge.net/msg33365.html
Signed-off-by: Gert Doering <ger= t@...1296...>
---
M src/openvpn/init.c
1 file changed, 2 insert= ions(+), 2 deletions(-)

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
ind= ex aaa0573..aa2611d 100644
--- a/src/openvpn/init.c<= br>+++ b/src/openvpn/init.c
@@ -2728,8 +2728,8 @@


/* Ensure that for epoch data format is= only enabled if also data v2
* is enabled */<= br>- bool epoch_data =3D (c-&g= t;options.imported_protocol_flags & CO_EPOCH_DATA_KEY_FORMAT);- bool datav2_enabled =3D (c= ->options.peer_id >=3D 0 && c->options.peer_id < MAX_PE= ER_ID);
+ bool epo= ch_data =3D c->options.imported_protocol_flags & CO_EPOCH_DATA_KEY_F= ORMAT;
+ bool data= v2_enabled =3D c->options.use_peer_id && c->options.peer_id &= lt; MAX_PEER_ID;

if (epoch_data &= ;& !datav2_enabled)
{

<= /pre>

To view, visit change 1273. To unsubscribe, or for help writing mail fi= lters, visit set= tings.

=
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia713a2ecfcad7032863867630a0= c306ff9f90385
Gerrit-Change-Number: 1273
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --lB1s0pwl0o8=--