From: "flichtenheld (Code Review)" Date: Fri, 13 Feb 2026 18:44:57 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="EFc5GI84hY4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: ssl: Avoid sign-compare warning in should_trigger_renegotiation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --EFc5GI84hY4= 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/+/1526?usp=3Demail to review the following change. Change subject: ssl: Avoid sign-compare warning in should_trigger_renegotia= tion ...................................................................... ssl: Avoid sign-compare warning in should_trigger_renegotiation Check that the value is positive and then cast it to counter_type. Change-Id: I701452496bb47c58b9728b08104dd5cb7823a94f Signed-off-by: Frank Lichtenheld --- M src/openvpn/ssl.c 1 file changed, 2 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/26/1526/1 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index aac31c2..b053dbf 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -2909,11 +2909,6 @@ return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - /** * Determines if a renegotiation should be triggerred based on the various * factors that can trigger one @@ -2929,13 +2924,13 @@ } /* Byte limit */ - if (session->opt->renegotiate_bytes > 0 && ks->n_bytes >=3D session->o= pt->renegotiate_bytes) + if (session->opt->renegotiate_bytes > 0 && ks->n_bytes >=3D (counter_t= ype)session->opt->renegotiate_bytes) { return true; } /* Packet limit */ - if (session->opt->renegotiate_packets && ks->n_packets >=3D session->o= pt->renegotiate_packets) + if (session->opt->renegotiate_packets > 0 && ks->n_packets >=3D (count= er_type)session->opt->renegotiate_packets) { return true; } @@ -2993,10 +2988,6 @@ return false; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /* * This is the primary routine for processing TLS stuff inside the * the main event loop. When this routine exits -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1526?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: I701452496bb47c58b9728b08104dd5cb7823a94f Gerrit-Change-Number: 1526 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --EFc5GI84hY4= 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

ssl: Avoid sign-compare warning in should_t=
rigger_renegotiation

Check that the value is positive and then cast = it
to counter_type.

Change-Id: I701452496bb47c58b9728b08104dd5cb7= 823a94f
Signed-off-by: Frank Lichtenheld <frank@...2641...>
---=
M src/openvpn/ssl.c
1 file changed, 2 insertions(+), 11 deletions(-)=

git pull ssh://gerrit.openvpn.net:29418/openvpn=
 refs/changes/26/1526/1
diff --git a/src/openvpn/ssl.c b/src/openvp=
n/ssl.c
index aac31c2..b053dbf 100644
--- a= /src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
= @@ -2909,11 +2909,6 @@
return true;
}=

-#if= defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compar= e"
-#endif<= br>-
/**<= br> * Determines if a renegotiation should be triggerred based on th= e various
* factors that can trigger one
= @@ -2929,13 +2924,13 @@
}

= /* Byte limit */
- if (session->opt->renegotiate_bytes > 0 && ks-&g= t;n_bytes >=3D session->opt->renegotiate_bytes)
+ if (session->opt->renegotiat= e_bytes > 0 && ks->n_bytes >=3D (counter_type)session->= opt->renegotiate_bytes)
{
= return true;
}

= /* Packet limit */
- = if (session->opt->renegotiate_packets && ks->n_packets &g= t;=3D session->opt->renegotiate_packets)
+ if (session->opt->renegotiate_packets = > 0 && ks->n_packets >=3D (counter_type)session->opt-&g= t;renegotiate_packets)
{
retu= rn true;
}
@@ -2993,10 +2988,6 @@
return false;
}
<= br>-#if defined(__GNUC__) || defi= ned(__clang__)
-#pragma= GCC diagnostic pop
-#e= ndif
-
= /*
* This is the primary routine for processing TLS stuf= f inside the
* the main event loop. When this routine ex= its

To view, visit change 1526. To unsubscr= ibe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I701452496bb47c58b9728b08104= dd5cb7823a94f
Gerrit-Change-Number: 1526
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...>
= --EFc5GI84hY4=--