From: "flichtenheld (Code Review)" Date: Fri, 6 Mar 2026 11:56:43 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, gert@...1296... Message-ID: <7561493e6c8063a2ae7ab1c42fcaa07269f17255-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="CPVNIEgbA5U="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: route: Fix type of rgi_needed variables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --CPVNIEgbA5U= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello cron2, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1505?usp=3Demail to look at the new patch set (#6). The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied= now. Change subject: route: Fix type of rgi_needed variables ...................................................................... route: Fix type of rgi_needed variables To avoid unneccesary sign-compare warnings. Change-Id: I2b2a931e13670d753aa9570efe498647ba1a4a7f Signed-off-by: Frank Lichtenheld --- M src/openvpn/route.c 1 file changed, 2 insertions(+), 20 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/05/1505/6 diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 329f3b0..b196713 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -570,11 +570,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - static void add_block_local_routes(struct route_list *rl) { @@ -602,15 +597,11 @@ bool block_local_needed(const struct route_list *rl) { - const int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEFINED); + const unsigned int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEFI= NED); return (rl->flags & RG_BLOCK_LOCAL) && (rl->rgi.flags & rgi_needed) = =3D=3D rgi_needed && (rl->spec.flags & RTSA_REMOTE_ENDPOINT) && rl->spec.remote_h= ost_local !=3D TLA_LOCAL; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - bool init_route_list(struct route_list *rl, const struct route_option_list *opt, const char *remote_endpoint, int default_metric, in_addr_t= remote_host, @@ -1445,17 +1436,12 @@ #define LR_MATCH 1 /* route is local */ #define LR_ERROR 2 /* caller should abort adding route */ -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - static int local_route(in_addr_t network, in_addr_t netmask, in_addr_t gateway, const struct route_gateway_info *rgi) { /* set LR_MATCH on local host routes */ - const int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEFINED | RGI= _IFACE_DEFINED); + const unsigned int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEFI= NED | RGI_IFACE_DEFINED); if (rgi && (rgi->flags & rgi_needed) =3D=3D rgi_needed && gateway =3D= =3D rgi->gateway.addr && netmask =3D=3D 0xFFFFFFFF) { @@ -1479,10 +1465,6 @@ return LR_NOMATCH; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /* Return true if the "on-link" form of the route should be used. This is= when the gateway for * a route is specified as an interface rather than an address. */ #if defined(TARGET_LINUX) || defined(_WIN32) || defined(TARGET_DARWIN) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1505?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I2b2a931e13670d753aa9570efe498647ba1a4a7f Gerrit-Change-Number: 1505 Gerrit-PatchSet: 6 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld --CPVNIEgbA5U= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld, plaisthos.

flichtenheld uploaded patch set #6 to this change.

<= p>View C= hange

The change is no longer submittable: checks~ChecksSubmitRul= e is unsatisfied now.

route: Fix type of rgi_needed variab=
les

To avoid unneccesary sign-compare warnings.

Change-Id: I2= b2a931e13670d753aa9570efe498647ba1a4a7f
Signed-off-by: Frank Lichtenheld= <frank@...2641...>
---
M src/openvpn/route.c
1 file changed= , 2 insertions(+), 20 deletions(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/05/1505/6
diff --=
git a/src/openvpn/route.c b/src/openvpn/route.c
index 329f3= b0..b196713 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -570,11 +570,6 @@
= }
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pu= sh
-#pragma GCC diagnos= tic ignored "-Wsign-compare"
-#endif
-
static void
add_block_local_routes(str= uct route_list *rl)
{
@@ -602,15 +597,11 @= @
bool
block_local_needed(const struct ro= ute_list *rl)
{
- const int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEF= INED);
+ const uns= igned int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEFINED); return (rl->flags & RG_BLOCK_LOCAL) && (rl->= rgi.flags & rgi_needed) =3D=3D rgi_needed
&= amp;& (rl->spec.flags & RTSA_REMOTE_ENDPOINT) && rl->= spec.remote_host_local !=3D TLA_LOCAL;
}
=
-#if defined(__GNUC__)= || defined(__clang__)
= -#pragma GCC diagnostic pop
-#endif
- bool
init_route_list(struct route_list *rl, const= struct route_option_list *opt,
const char= *remote_endpoint, int default_metric, in_addr_t remote_host,
@@ -1445,17 +1436,12 @@

#define LR_MATCH 1 /* route i= s local */
#define LR_ERROR 2 /* caller should abort add= ing route */

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "= -Wsign-compare"
-#= endif
-
static int
local_route(in_addr_t network, in_addr_t netm= ask, in_addr_t gateway,
const struct route_gat= eway_info *rgi)
{
/* set LR_MATCH on = local host routes */
- = const int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEFINED | RGI_I= FACE_DEFINED);
+ c= onst unsigned int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_DEFINED | = RGI_IFACE_DEFINED);
if (rgi && (rgi->flags = & rgi_needed) =3D=3D rgi_needed && gateway =3D=3D rgi->gatew= ay.addr
&& netmask =3D=3D 0xFFFFFFFF)

{
@@ -1479,10 +1465,6 @@
= return LR_NOMATCH;
}

-#if defined(__GNUC__) || defined(__cl= ang__)
-#pragma GCC dia= gnostic pop
-#endif
-
/* Retu= rn true if the "on-link" form of the route should be used. This = is when the gateway for
* a route is specified as an inte= rface rather than an address. */
#if defined(TARGET_LINUX)= || defined(_WIN32) || defined(TARGET_DARWIN)

To view, visit change 1505. To unsubscribe, or for help writing mail fil= ters, visit sett= ings.

<= link itemprop=3D"url" href=3D"http://gerrit.openvpn.net/c/openvpn/+/1505?us= p=3Demail"/>
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2b2a931e13670d753aa9570efe4= 98647ba1a4a7f
Gerrit-Change-Number: 1505
Gerrit-PatchSet: 6
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --CPVNIEgbA5U=--