From: "cron2 (Code Review)" Date: Fri, 6 Mar 2026 16:20:39 +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="L/RHBt5mNB0="; 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: flichtenheld Cc: plaisthos , openvpn-devel --L/RHBt5mNB0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/15= 05?usp=3Demail ) 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 Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1505 Message-Id: <20260305084914.1327-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 926.html Signed-off-by: Gert Doering --- M src/openvpn/route.c 1 file changed, 2 insertions(+), 20 deletions(-) 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: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I2b2a931e13670d753aa9570efe498647ba1a4a7f Gerrit-Change-Number: 1505 Gerrit-PatchSet: 7 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --L/RHBt5mNB0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

route: Fix type of rgi_needed variables

T= o avoid unneccesary sign-compare warnings.

Change-Id: I2b2a931e13670= d753aa9570efe498647ba1a4a7f
Signed-off-by: Frank Lichtenheld <frank@...220...= ..2641...>
Acked-by: Gert Doering <gert@...1296...>
Gerrit U= RL: https://gerrit.openvpn.net/c/openvpn/+/1505
Message-Id: <20260305= 084914.1327-1-gert@...1296...>
URL: https://www.mail-archive.com/open= vpn-devel@lists.sourceforge.net/msg35926.html
Signed-off-by: Gert Doerin= g <gert@...1296...>
---
M src/openvpn/route.c
1 file changed= , 2 insertions(+), 20 deletions(-)

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
i= ndex 329f3b0..b196713 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -570,11 +570,6 @@<= /span>
}
}

-#if defined(__GNUC__) || defined(__cl= ang__)

-#pragma GCC dia= gnostic push
-#pragma G= CC 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_N= ETMASK_DEFINED);
+ = const unsigned 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
= && (rl->spec.flags & RTSA_REMOTE_ENDPOINT) &&am= p; rl->spec.remote_host_local !=3D TLA_LOCAL;
}<= br>
-#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 ignor= ed "-Wsign-compare"
-#endif
-=
static int
local_route(in_addr_t network, in_ad= dr_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_DEFINE= D | RGI_IFACE_DEFINED);
+ const unsigned int rgi_needed =3D (RGI_ADDR_DEFINED | RGI_NETMASK_D= EFINED | RGI_IFACE_DEFINED);
if (rgi && (rgi-&= gt;flags & rgi_needed) =3D=3D rgi_needed && gateway =3D=3D rgi-= >gateway.addr
&& netmask =3D=3D 0xFFFFF= FFF)
{
@@ -1479,10 +1465,6 @@ return LR_NOMATCH;
}
=
-#if defined(__GNUC__) || def= ined(__clang__)
-#pragm= a GCC diagnostic pop
-#= endif
-
/* Return true if the "on-link" form of the route should be use= d. This is when the gateway for
* a route is specified a= s an interface rather than an address. */
#if defined(TARG= ET_LINUX) || defined(_WIN32) || defined(TARGET_DARWIN)

To view, visit change 1505. To unsubscribe, or for help writing= mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2b2a931e13670d753aa9570efe4= 98647ba1a4a7f
Gerrit-Change-Number: 1505
Gerrit-PatchSet: 7
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>
= --L/RHBt5mNB0=--