From: "flichtenheld (Code Review)" Date: Thu, 24 Jul 2025 12:31:46 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <71b0024a5a88209dcbac0f3d010df509d4d182c8-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Feu14/6BnYM="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: route: Make sure various route flags are treated as unsigned List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --Feu14/6BnYM= 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/+/1109?usp=3Demail to review the following change. Change subject: route: Make sure various route flags are treated as unsigned ...................................................................... route: Make sure various route flags are treated as unsigned The variables that hold them are already unsigned, make sure the flags are as well to avoid spurious conversion warnings. Change-Id: Ib7f78abbcd52c00a32afdea36ef635681ac8e127 Signed-off-by: Frank Lichtenheld --- M src/openvpn/route.h 1 file changed, 14 insertions(+), 14 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/09/1109/1 diff --git a/src/openvpn/route.h b/src/openvpn/route.h index 237375c..f015a12 100644 --- a/src/openvpn/route.h +++ b/src/openvpn/route.h @@ -83,14 +83,14 @@ }; /* redirect-gateway flags */ -#define RG_ENABLE (1<<0) -#define RG_LOCAL (1<<1) -#define RG_DEF1 (1<<2) -#define RG_BYPASS_DHCP (1<<3) -#define RG_BYPASS_DNS (1<<4) -#define RG_REROUTE_GW (1<<5) -#define RG_AUTO_LOCAL (1<<6) -#define RG_BLOCK_LOCAL (1<<7) +#define RG_ENABLE (1u<<0) +#define RG_LOCAL (1u<<1) +#define RG_DEF1 (1u<<2) +#define RG_BYPASS_DHCP (1u<<3) +#define RG_BYPASS_DNS (1u<<4) +#define RG_REROUTE_GW (1u<<5) +#define RG_AUTO_LOCAL (1u<<6) +#define RG_BLOCK_LOCAL (1u<<7) =20 struct route_option_list { unsigned int flags; /* RG_x flags */ @@ -113,9 +113,9 @@ }; struct route_ipv4 { -#define RT_DEFINED (1<<0) -#define RT_ADDED (1<<1) -#define RT_METRIC_DEFINED (1<<2) +#define RT_DEFINED (1u<<0) +#define RT_ADDED (1u<<1) +#define RT_METRIC_DEFINED (1u<<2) struct route_ipv4 *next; unsigned int flags; const struct route_option *option; @@ -216,9 +216,9 @@ }; struct route_list { -#define RL_DID_REDIRECT_DEFAULT_GATEWAY (1<<0) -#define RL_DID_LOCAL (1<<1) -#define RL_ROUTES_ADDED (1<<2) +#define RL_DID_REDIRECT_DEFAULT_GATEWAY (1u<<0) +#define RL_DID_LOCAL (1u<<1) +#define RL_ROUTES_ADDED (1u<<2) unsigned int iflags; struct route_special_addr spec; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1109?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ib7f78abbcd52c00a32afdea36ef635681ac8e127 Gerrit-Change-Number: 1109 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --Feu14/6BnYM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

route: Make sure various route flags are treated as unsigned=


The variables that hold them are already unsigned, make sure
the= flags are as well to avoid spurious conversion warnings.

Change-Id:= Ib7f78abbcd52c00a32afdea36ef635681ac8e127
Signed-off-by: Frank Lichtenh= eld <frank@...2641...>
---
M src/openvpn/route.h
1 file chan= ged, 14 insertions(+), 14 deletions(-)

git pull ssh://gerrit.open=
vpn.net:29418/openvpn refs/changes/09/1109/1
diff --git a/src/openv=
pn/route.h b/src/openvpn/route.h
index 237375c..f015a12 100= 644
--- a/src/openvpn/route.h
+++ b/src/ope= nvpn/route.h
@@ -83,14 +83,14 @@
};=

/* redirect-gateway flags */
-#define RG_ENABLE (1<<0)<= /span>
-#define RG_LOCAL = (1<<1)
-#defi= ne RG_DEF1 (1<<2)
-#define RG_BYPASS_DHCP (1<<3)
-#define RG_BYPASS_DNS (1<<4)<= br>-#define RG_REROUTE_GW (1&= lt;<5)
-#define RG_A= UTO_LOCAL (1<<6)
-#define RG_BLOCK_LOCAL (1<<7)
+#define RG_ENABLE (1u<<0)
<= span style=3D"color: hsl(120, 100%, 40%);">+#define RG_LOCAL (1u&l= t;<1)

+#define RG_= DEF1 (1u<<2)
+#define RG_BYPASS_DHCP (1u<<3)
+#define RG_BYPASS_DNS (1u<<4)=
+#define RG_REROUTE_GW = (1u<<5)
+#defin= e RG_AUTO_LOCAL (1u<<6)
+#define RG_BLOCK_LOCAL (1u<<7)

struct route_option_list {
unsigned int = flags; /* RG_x flags */
@@ -113,9 +113,9 @@
};


struct route_ipv4 {
-#define RT_DEFINED (1<<0= )
-#define RT_ADDED = (1<<1)
-#de= fine RT_METRIC_DEFINED (1<<2)
+#define RT_DEFINED (1u<<0)
+#define RT_ADDED (1u<<1)=
+#define RT_METRIC_D= EFINED (1u<<2)
struct route_ipv4 *next; unsigned int flags;
const struct route_op= tion *option;
@@ -216,9 +216,9 @@
};


struct route_list {
-#define RL_DID_REDIRECT_DEFAULT_GATEWAY (1<&= lt;0)
-#define RL_DID_L= OCAL (1<<1)
-#define RL_ROUTES_ADDED (1<<2)<= br>+#define RL_DID_REDIRECT_DEF= AULT_GATEWAY (1u<<0)
+#define RL_DID_LOCAL (1u<<1)
+#define RL_ROUTES_ADDED = (1u<<2)
unsigned int iflags;

struct route_special_addr spec;
<= /span>

To view, visit change 1109. To unsubscribe, or for help writ= ing mail filters, visit sett= ings.

<= link itemprop=3D"url" href=3D"http://gerrit.openvpn.net/c/openvpn/+/1109?us= p=3Demail"/>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib7f78abbcd52c00a32afdea36ef= 635681ac8e127
Gerrit-Change-Number: 1109
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...>
Gerrit-MessageType: newchange
--Feu14/6BnYM=--