From: "flichtenheld (Code Review)"
Date: Thu, 7 Aug 2025 17:02:30 +0000
In-Reply-To:
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net
Message-ID: <5f6c453d3f2ad33fc2f98d1f8d020cb65e15b660-EmailReplacePatchSet-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="sIfhDiovc+w="; charset=UTF-8
Subject: [Openvpn-devel] [M] Change in openvpn[master]: options: Make sure
option types are treated as unsigned
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: plaisthos
Cc: openvpn-devel
--sIfhDiovc+w=
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 reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1106?usp=3Demail
to look at the new patch set (#7).
Change subject: options: Make sure option types are treated as unsigned
......................................................................
options: Make sure option types are treated as unsigned
verify_permissions already expects them to be unsigned,
make sure they are to avoid spurious conversion warnings.
Change-Id: I1d27cb81d32058e40147e1d6dcd12df7f6cb2b30
Signed-off-by: Frank Lichtenheld
---
M src/openvpn/options.h
M src/openvpn/ssl_ncp.c
2 files changed, 33 insertions(+), 33 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/06/1106/7
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index 5ee6e93..7dc2912 100644
--- a/src/openvpn/options.h
+++ b/src/openvpn/options.h
@@ -729,38 +729,38 @@
/*
* Option classes.
*/
-#define OPT_P_GENERAL (1 << 0)
-#define OPT_P_UP (1 << 1)
-#define OPT_P_ROUTE (1 << 2)
-#define OPT_P_DHCPDNS (1 << 3) /* includes ip windows options like=
*/
-#define OPT_P_SCRIPT (1 << 4)
-#define OPT_P_SETENV (1 << 5)
-#define OPT_P_SHAPER (1 << 6)
-#define OPT_P_TIMER (1 << 7)
-#define OPT_P_PERSIST (1 << 8)
-#define OPT_P_PERSIST_IP (1 << 9)
-#define OPT_P_COMP (1 << 10) /* TODO */
-#define OPT_P_MESSAGES (1 << 11)
-#define OPT_P_NCP (1 << 12) /**< Negotiable crypto parameters =
*/
-#define OPT_P_TLS_PARMS (1 << 13) /* TODO */
-#define OPT_P_MTU (1 << 14) /* TODO */
-#define OPT_P_NICE (1 << 15)
-#define OPT_P_PUSH (1 << 16)
-#define OPT_P_INSTANCE (1 << 17) /**< allowed in ccd, client-connec=
t etc*/
-#define OPT_P_CONFIG (1 << 18)
-#define OPT_P_EXPLICIT_NOTIFY (1 << 19)
-#define OPT_P_ECHO (1 << 20)
-#define OPT_P_INHERIT (1 << 21)
-#define OPT_P_ROUTE_EXTRAS (1 << 22)
-#define OPT_P_PULL_MODE (1 << 23)
-#define OPT_P_PLUGIN (1 << 24)
-#define OPT_P_SOCKBUF (1 << 25)
-#define OPT_P_SOCKFLAGS (1 << 26)
-#define OPT_P_CONNECTION (1 << 27)
-#define OPT_P_PEER_ID (1 << 28)
-#define OPT_P_INLINE (1 << 29)
-#define OPT_P_PUSH_MTU (1 << 30)
-#define OPT_P_ROUTE_TABLE (1 << 31)
+#define OPT_P_GENERAL (1u << 0)
+#define OPT_P_UP (1u << 1)
+#define OPT_P_ROUTE (1u << 2)
+#define OPT_P_DHCPDNS (1u << 3) /* includes ip windows options lik=
e */
+#define OPT_P_SCRIPT (1u << 4)
+#define OPT_P_SETENV (1u << 5)
+#define OPT_P_SHAPER (1u << 6)
+#define OPT_P_TIMER (1u << 7)
+#define OPT_P_PERSIST (1u << 8)
+#define OPT_P_PERSIST_IP (1u << 9)
+#define OPT_P_COMP (1u << 10) /* TODO */
+#define OPT_P_MESSAGES (1u << 11)
+#define OPT_P_NCP (1u << 12) /**< Negotiable crypto parameters=
*/
+#define OPT_P_TLS_PARMS (1u << 13) /* TODO */
+#define OPT_P_MTU (1u << 14) /* TODO */
+#define OPT_P_NICE (1u << 15)
+#define OPT_P_PUSH (1u << 16)
+#define OPT_P_INSTANCE (1u << 17) /**< allowed in ccd, client-conne=
ct etc*/
+#define OPT_P_CONFIG (1u << 18)
+#define OPT_P_EXPLICIT_NOTIFY (1u << 19)
+#define OPT_P_ECHO (1u << 20)
+#define OPT_P_INHERIT (1u << 21)
+#define OPT_P_ROUTE_EXTRAS (1u << 22)
+#define OPT_P_PULL_MODE (1u << 23)
+#define OPT_P_PLUGIN (1u << 24)
+#define OPT_P_SOCKBUF (1u << 25)
+#define OPT_P_SOCKFLAGS (1u << 26)
+#define OPT_P_CONNECTION (1u << 27)
+#define OPT_P_PEER_ID (1u << 28)
+#define OPT_P_INLINE (1u << 29)
+#define OPT_P_PUSH_MTU (1u << 30)
+#define OPT_P_ROUTE_TABLE (1u << 31)
#define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))
diff --git a/src/openvpn/ssl_ncp.c b/src/openvpn/ssl_ncp.c
index 5e094a2..51f7f92 100644
--- a/src/openvpn/ssl_ncp.c
+++ b/src/openvpn/ssl_ncp.c
@@ -307,7 +307,7 @@
}
bool
-check_pull_client_ncp(struct context *c, const int found)
+check_pull_client_ncp(struct context *c, const unsigned int found)
{
if (found & OPT_P_NCP)
{
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1106?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: I1d27cb81d32058e40147e1d6dcd12df7f6cb2b30
Gerrit-Change-Number: 1106
Gerrit-PatchSet: 7
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-MessageType: newpatchset
--sIfhDiovc+w=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: plaisthos.
flichtenheld uploaded patch set #7 to this change.
<=
p>View C=
hange
options: Make sure option types are treated as unsigned
ve=
rify_permissions already expects them to be unsigned,
make sure they are=
to avoid spurious conversion warnings.
Change-Id: I1d27cb81d32058e4=
0147e1d6dcd12df7f6cb2b30
Signed-off-by: Frank Lichtenheld <frank@...1665...=
641...>
---
M src/openvpn/options.h
M src/openvpn/ssl_ncp.c
=
2 files changed, 33 insertions(+), 33 deletions(-)
git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/06/1106/7
diff --=
git a/src/openvpn/options.h b/src/openvpn/options.h
index 5=
ee6e93..7dc2912 100644
--- a/src/openvpn/options.h+++ b/src/openvpn/options.h
@@ -729,38 +729,38 @@=
span>
/*
* Option classes.
*/=
-#define OPT_P_GENERAL=
(1 << 0)
-#define OPT_P_UP (1 << 1)
-#define OPT_P_ROUTE (1 << 2)
-#define OPT_P_DHCPDNS =
(1 << 3) /* includes ip windows options like */
-#define OPT_P_SCRIPT (1 <<=
; 4)
-#define OPT_P_SET=
ENV (1 << 5)
-#define OPT_P_SHAPER (1 << 6)
-#define OPT_P_TIMER (1 << 7)=
span>
-#define OPT_P_PERSIST =
(1 << 8)
-=
#define OPT_P_PERSIST_IP (1 << 9)
-#define OPT_P_COMP (1 << 10) /* TOD=
O */
-#define OPT_P_MES=
SAGES (1 << 11)
-#define OPT_P_NCP (1 << 12) /**< Negotiable cry=
pto parameters */
-#def=
ine OPT_P_TLS_PARMS (1 << 13) /* TODO */
-#define OPT_P_MTU (1 << 1=
4) /* TODO */
-#define =
OPT_P_NICE (1 << 15)
-#define OPT_P_PUSH (1 << 16)
-#define OPT_P_INSTANCE (1 &l=
t;< 17) /**< allowed in ccd, client-connect etc*/
-#define OPT_P_CONFIG (1 <<=
18)
-#define OPT_P_EXP=
LICIT_NOTIFY (1 << 19)
-#define OPT_P_ECHO (1 << 20)
-#define OPT_P_INHERIT (1 << 2=
1)
-#define OPT_P_ROUTE=
_EXTRAS (1 << 22)
-#define OPT_P_PULL_MODE (1 << 23)
-#define OPT_P_PLUGIN (1 << 24)<=
/span>
-#define OPT_P_SOCKBUF =
(1 << 25)
-#define OPT_P_SOCKFLAGS (1 << 26)
-#define OPT_P_CONNECTION (1 << 27)
-#define OPT_P_PEER_ID =
(1 << 28)
-#=
define OPT_P_INLINE (1 << 29)
-#define OPT_P_PUSH_MTU (1 << 30)=
-#define OPT_P_ROUTE_TABLE =
(1 << 31)
+#d=
efine OPT_P_GENERAL (1u << 0)
+#define OPT_P_UP (1u << 1)
+#define OPT_P_ROUTE =
(1u << 2)
=
+#define OPT_P_DHCPDNS (1u << 3) /* includes ip windows optio=
ns like */
+#define O=
PT_P_SCRIPT (1u << 4)
+#define OPT_P_SETENV (1u << 5)
+#define OPT_P_SHAPER (1=
u << 6)
+#defin=
e OPT_P_TIMER (1u << 7)
+#define OPT_P_PERSIST (1u << 8)
+#define OPT_P_PERSIST_IP =
(1u << 9)
+#de=
fine OPT_P_COMP (1u << 10) /* TODO */
+#define OPT_P_MESSAGES (1u <&l=
t; 11)
+#define OPT_P=
_NCP (1u << 12) /**< Negotiable crypto parameters */=
span>
+#define OPT_P_TLS_PAR=
MS (1u << 13) /* TODO */
+#define OPT_P_MTU (1u << 14) /* TODO */<=
/span>
+#define OPT_P_NICE =
(1u << 15)
+#define OPT_P_PUSH (1u << 16)
+#define OPT_P_INSTANCE (1u <<=
; 17) /**< allowed in ccd, client-connect etc*/
+#define OPT_P_CONFIG (1u << 1=
8)
+#define OPT_P_EXP=
LICIT_NOTIFY (1u << 19)
+#define OPT_P_ECHO (1u << 20)
+#define OPT_P_INHERIT (1u <=
< 21)
+#define OPT=
_P_ROUTE_EXTRAS (1u << 22)
+#define OPT_P_PULL_MODE (1u << 23)
+#define OPT_P_PLUGIN (1=
u << 24)
+#defi=
ne OPT_P_SOCKBUF (1u << 25)
+#define OPT_P_SOCKFLAGS (1u << 26)=
+#define OPT_P_CONNECTION =
(1u << 27)
=
+#define OPT_P_PEER_ID (1u << 28)
+#define OPT_P_INLINE (1u << 29)<=
/span>
+#define OPT_P_PUSH_M=
TU (1u << 30)
+#define OPT_P_ROUTE_TABLE (1u << 31)
#define OPT_P_DEFAULT (~(OPT_P_INSTANCE | OPT_P_PULL_MODE))=
span>
diff --git a/src/openvpn/ssl_ncp.c b/src/o=
penvpn/ssl_ncp.c
index 5e094a2..51f7f92 100644
--- a/src/openvpn/ssl_ncp.c
+++ b/src/openvpn/ssl_ncp.c=
@@ -307,7 +307,7 @@
}
=
span>
bool
-c=
heck_pull_client_ncp(struct context *c, const int found)
+check_pull_client_ncp(struct context *=
c, const unsigned int found)
{
if (fo=
und & OPT_P_NCP)
{
To view, visit change 1106. To unsubscribe, or for help writing mail filte=
rs, visit settings.
<=
div itemscope itemtype=3D"http://schema.org/EmailMessage"><=
meta itemprop=3D"name" content=3D"View Change"/>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1d27cb81d32058e40147e1d6dcd=
12df7f6cb2b30
Gerrit-Change-Number: 1106
Gerrit-PatchSet: 7
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: newpatchset
--sIfhDiovc+w=--