From: "flichtenheld (Code Review)" Date: Tue, 14 Oct 2025 11:34:01 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <6a6d9422beb71ba935a1ef5f9dc09d4855036a60-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="npqmLaIDxBY="; 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: plaisthos Cc: openvpn-devel --npqmLaIDxBY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1273?usp=3Demail to review the following change. 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 --- M src/openvpn/init.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/73/1273/1 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: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ia713a2ecfcad7032863867630a0c306ff9f90385 Gerrit-Change-Number: 1273 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --npqmLaIDxBY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

init: Fix datav2_enabled check in options i=
mport

peer_id is unsigned, so the previous check was partly
usele= ss. Instead check use_peer_id.

Change-Id: Ia713a2ecfcad7032863867630= a0c306ff9f90385
Signed-off-by: Frank Lichtenheld <frank@...2641...>= ;
---
M src/openvpn/init.c
1 file changed, 2 insertions(+), 2 dele= tions(-)

git pull ssh://gerrit.openvpn.net:29418=
/openvpn refs/changes/73/1273/1
diff --git a/src/openvpn/init.c b/s=
rc/openvpn/init.c
index aaa0573..aa2611d 100644
<= span>--- 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_DATA_KEY_FORMAT);
- bool datav2_enabled =3D (c->options.peer_id >=3D 0 &&a= mp; c->options.peer_id < MAX_PEER_ID);
+ bool epoch_data =3D c->options.imported_pro= tocol_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 change 1273. To uns= ubscribe, or for help writing mail filters, visit settings.

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