From: "cron2 (Code Review)" Date: Wed, 27 Aug 2025 09:13:33 +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="i1D3izzBB3k="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: comp: Make sure comp flags are treated as unsigned List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --i1D3izzBB3k= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/11= 02?usp=3Demail ) Change subject: comp: Make sure comp flags are treated as unsigned ...................................................................... comp: Make sure comp flags are treated as unsigned compress_options.flags is already unsigned. Make sure the individual flags are as well to avoid spurious conversion warnings. Change-Id: I6a0d352a039a0936cb9bbedf6168cd6eecd053ea Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Message-Id: <20250826185007.22157-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 689.html Signed-off-by: Gert Doering --- M src/openvpn/comp.h 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openvpn/comp.h b/src/openvpn/comp.h index 265e15d..0354896 100644 --- a/src/openvpn/comp.h +++ b/src/openvpn/comp.h @@ -32,23 +32,23 @@ /* Compression flags */ /* Removed - #define COMP_F_ADAPTIVE (1<<0) / * COMP_ALG_LZO only * / - #define COMP_F_ALLOW_COMPRESS (1<<1) / * not only incoming is compr= essed but also outgoing * + #define COMP_F_ADAPTIVE (1u<<0) / * COMP_ALG_LZO only * / + #define COMP_F_ALLOW_COMPRESS (1u<<1) / * not only incoming is comp= ressed but also outgoing * / */ /** initial command byte is swapped with last byte in buffer to preserve p= ayload alignment */ -#define COMP_F_SWAP (1 << 2) +#define COMP_F_SWAP (1u << 2) /** tell server that we only support compression stubs */ -#define COMP_F_ADVERTISE_STUBS_ONLY (1 << 3) +#define COMP_F_ADVERTISE_STUBS_ONLY (1u << 3) /** Only accept stub compression, even with COMP_F_ADVERTISE_STUBS_ONLY * we still accept other compressions to be pushed */ -#define COMP_F_ALLOW_STUB_ONLY (1 << 4) +#define COMP_F_ALLOW_STUB_ONLY (1u << 4) /** push stub-v2 or comp-lzo no when we see a client with comp-lzo in occ = */ -#define COMP_F_MIGRATE (1 << 5) +#define COMP_F_MIGRATE (1u << 5) /** Compression was explicitly set to allow asymetric compression */ -#define COMP_F_ALLOW_ASYM (1 << 6) +#define COMP_F_ALLOW_ASYM (1u << 6) /** Do not allow compression framing (breaks DCO) */ -#define COMP_F_ALLOW_NOCOMP_ONLY (1 << 7) +#define COMP_F_ALLOW_NOCOMP_ONLY (1u << 7) /* algorithms */ #define COMP_ALG_UNDEF 0 -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1102?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: I6a0d352a039a0936cb9bbedf6168cd6eecd053ea Gerrit-Change-Number: 1102 Gerrit-PatchSet: 9 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --i1D3izzBB3k= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

comp: Make sure comp flags are treated as uns=
igned

compress_options.flags is already unsigned. Make sure
the i= ndividual flags are as well to avoid spurious
conversion warnings.
Change-Id: I6a0d352a039a0936cb9bbedf6168cd6eecd053ea
Signed-off-by: Fr= ank Lichtenheld <frank@...2641...>
Acked-by: Arne Schwabe <arne= -openvpn@...1227...>
Message-Id: <20250826185007.22157-1-gert@...1386...= 296...>
URL: https://www.mail-archive.com/openvpn-devel@...1535...= orge.net/msg32689.html
Signed-off-by: Gert Doering <gert@...1296...&g= t;
---
M src/openvpn/comp.h
1 file changed, 8 insertions(+), 8 del= etions(-)

diff --git a/src/openvpn/comp.h b/src/openvpn/comp.h
ind= ex 265e15d..0354896 100644
--- a/src/openvpn/comp.h<= br>+++ b/src/openvpn/comp.h
@@ -32,23 +32,23 @@

/* Compression flags */
/* R= emoved
- #define COMP_F= _ADAPTIVE (1<<0) / * COMP_ALG_LZO only * /
- #define COMP_F_ALLOW_COMPRESS = (1<<1) / * not only incoming is compressed but also outgoing *
+ #define COMP_F_ADAPTIVE = (1u<<0) / * COMP_ALG_LZO only * /
+ #define COMP_F_ALLOW_COMPRESS (1u&= lt;<1) / * not only incoming is compressed but also outgoing * /
*/
/** initial command byte i= s swapped with last byte in buffer to preserve payload alignment */<= br>-#define COMP_F_SWAP = (1 << 2)
+#define COMP_F_SWAP (1u << 2)
/** = tell server that we only support compression stubs */
-#define COMP_F_ADVERTISE_STUBS_ONLY (1 <= < 3)
+#define COMP= _F_ADVERTISE_STUBS_ONLY (1u << 3)
/** Only accept st= ub compression, even with COMP_F_ADVERTISE_STUBS_ONLY
* w= e still accept other compressions to be pushed */
-#define COMP_F_ALLOW_STUB_ONLY (1 <<= 4)
+#define COMP_F_A= LLOW_STUB_ONLY (1u << 4)
/** push stub-v2 or co= mp-lzo no when we see a client with comp-lzo in occ */
-#define COMP_F_MIGRATE (1 <= ;< 5)
+#define COM= P_F_MIGRATE (1u << 5)
/** Compression w= as explicitly set to allow asymetric compression */
-#define COMP_F_ALLOW_ASYM (1 <= < 6)
+#define COMP= _F_ALLOW_ASYM (1u << 6)
/** Do not allow c= ompression framing (breaks DCO) */
-#define COMP_F_ALLOW_NOCOMP_ONLY (1 << 7)
<= span style=3D"color: hsl(120, 100%, 40%);">+#define COMP_F_ALLOW_NOCOMP_ONL= Y (1u << 7)


/* algorithms */
#define COMP_ALG_UNDEF 0

<= p>To view, visit change 1102. To unsubscribe, or for help writing mail filters= , visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6a0d352a039a0936cb9bbedf616= 8cd6eecd053ea
Gerrit-Change-Number: 1102
Gerrit-PatchSet: 9
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--i1D3izzBB3k=--