From: "cron2 (Code Review)" Date: Sun, 14 Sep 2025 17:38:09 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <25439c251aac87ca22e6918cbcdec5c5912565e0-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="oRJaJbeWKbs="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: events: Make sure rwflags are treated as unsigned List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --oRJaJbeWKbs= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#11) to the change originally created b= y flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1107?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: events: Make sure rwflags are treated as unsigned ...................................................................... events: Make sure rwflags are treated as unsigned event_set_return.rwflags is already unsigned, make sure the flags are as well to avoid spurious conversion warnings. Requires to change rwflags in proxy_connection struct as well since those use the same flags. Change-Id: I0272b709b907545de05bfded03a649b259ce5af6 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering URL: https://gerrit.openvpn.net/c/openvpn/+/1107 Message-Id: <20250914135128.19621-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 918.html Signed-off-by: Gert Doering --- M src/openvpn/event.h M src/openvpn/ps.c 2 files changed, 10 insertions(+), 9 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/07/1107/11 diff --git a/src/openvpn/event.h b/src/openvpn/event.h index 8422996..8a89a25 100644 --- a/src/openvpn/event.h +++ b/src/openvpn/event.h @@ -35,8 +35,8 @@ #define WRITE_SHIFT 1 #define EVENT_UNDEF 4 -#define EVENT_READ (1 << READ_SHIFT) -#define EVENT_WRITE (1 << WRITE_SHIFT) +#define EVENT_READ (1u << READ_SHIFT) +#define EVENT_WRITE (1u << WRITE_SHIFT) /* event flags returned by io_wait. * diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c index e95a33b..a10df2e 100644 --- a/src/openvpn/ps.c +++ b/src/openvpn/ps.c @@ -70,7 +70,7 @@ struct proxy_connection *counterpart; struct buffer buf; bool buffer_initial; - int rwflags; + unsigned int rwflags; int sd; char *jfn; }; @@ -387,12 +387,12 @@ } static inline void -proxy_connection_io_requeue(struct proxy_connection *pc, const int rwflags= _new, +proxy_connection_io_requeue(struct proxy_connection *pc, const unsigned in= t rwflags_new, struct event_set *es) { if (socket_defined(pc->sd) && pc->rwflags !=3D rwflags_new) { - /*dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: requeue[%d] rwflags= =3D%d", (int)pc->sd, + /*dmsg (D_PS_PROXY_DEBUG, "PORT SHARE PROXY: requeue[%d] rwflags= =3D%u", (int)pc->sd, * rwflags_new);*/ event_ctl(es, pc->sd, rwflags_new, (void *)pc); pc->rwflags =3D rwflags_new; @@ -652,7 +652,7 @@ * Decide how the receipt of an EAGAIN status should affect our next IO qu= eueing. */ static bool -proxy_connection_io_status(const int status, int *rwflags_pc, int *rwflags= _cp) +proxy_connection_io_status(const int status, unsigned int *rwflags_pc, uns= igned int *rwflags_cp) { switch (status) { @@ -683,12 +683,13 @@ * in the proxied connection. */ static int -proxy_connection_io_dispatch(struct proxy_connection *pc, const int rwflag= s, struct event_set *es) +proxy_connection_io_dispatch(struct proxy_connection *pc, const unsigned i= nt rwflags, + struct event_set *es) { const int max_transfer_per_iteration =3D 10000; struct proxy_connection *cp =3D pc->counterpart; - int rwflags_pc =3D pc->rwflags; - int rwflags_cp =3D cp->rwflags; + unsigned int rwflags_pc =3D pc->rwflags; + unsigned int rwflags_cp =3D cp->rwflags; ASSERT(pc->defined && cp->defined && cp->counterpart =3D=3D pc); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1107?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: I0272b709b907545de05bfded03a649b259ce5af6 Gerrit-Change-Number: 1107 Gerrit-PatchSet: 11 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --oRJaJbeWKbs= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #11 to the change originally c= reated by flichtenheld.

View Change

The following approvals got out= dated and were removed: Code-Review+2 by cron2

events: Make sure rwflags are treated as unsigned
event_set_return.rwflags is already unsigned, make sure the
flags a= re as well to avoid spurious conversion warnings.

Requires to change= rwflags in proxy_connection struct as
well since those use the same fla= gs.

Change-Id: I0272b709b907545de05bfded03a649b259ce5af6
Signed-o= ff-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Gert Doering= <gert@...1296...>
URL: https://gerrit.openvpn.net/c/openvpn/+/110= 7
Message-Id: <20250914135128.19621-1-gert@...1296...>
URL: htt= ps://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32918.html=
Signed-off-by: Gert Doering <gert@...1296...>
---
M src/ope= nvpn/event.h
M src/openvpn/ps.c
2 files changed, 10 insertions(+), 9 = deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs=
/changes/07/1107/11
diff --git a/src/openvpn/event.h b/src/openvpn/=
event.h
index 8422996..8a89a25 100644
--- a= /src/openvpn/event.h
+++ b/src/openvpn/event.h
@@ -35,8 +35,8 @@
#define WRITE_SHIFT 1

#define EVENT_UNDEF 4
-#define EVENT_READ (1 << READ_SHIFT)
= -#define EVENT_WRITE (1 << = WRITE_SHIFT)
+#define= EVENT_READ (1u << READ_SHIFT)
+#define EVENT_WRITE (1u << WRITE_SHIFT)
<= span>
/* event flags returned by io_wait.
*
diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c

index e95a33b..a10df2e 100644
--- a/src/openvpn/= ps.c
+++ b/src/openvpn/ps.c
@@ -70,7 +70,7 = @@
struct proxy_connection *counterpart;
struct buffer buf;
bool buffer_initial;=
- int rwflags;
<= span style=3D"color: hsl(120, 100%, 40%);">+ unsigned int rwflags;
int sd;
char *jfn;
};=
@@ -387,12 +387,12 @@
}
=
static inline void
-proxy_connection_io_requeue(struct proxy_connection *pc, con= st int rwflags_new,
+= proxy_connection_io_requeue(struct proxy_connection *pc, const unsigned int= rwflags_new,
struct event_set= *es)
{
if (socket_defined(pc->sd)= && pc->rwflags !=3D rwflags_new)
{<= br>- /*dmsg (D_PS_PROXY_DE= BUG, "PORT SHARE PROXY: requeue[%d] rwflags=3D%d", (int)pc->sd= ,
+ /*dmsg (D_= PS_PROXY_DEBUG, "PORT SHARE PROXY: requeue[%d] rwflags=3D%u", (in= t)pc->sd,
* rwflags_new);*/
= event_ctl(es, pc->sd, rwflags_new, (void *)pc);
= pc->rwflags =3D rwflags_new;
@@ -652,7 +652,7 @@=
* Decide how the receipt of an EAGAIN status should affe= ct our next IO queueing.
*/
static bool<= /span>
-proxy_connection_io_st= atus(const int status, int *rwflags_pc, int *rwflags_cp)
+proxy_connection_io_status(const int s= tatus, unsigned int *rwflags_pc, unsigned int *rwflags_cp)
= {
switch (status)
{
@@ -683,12 +683,13 @@

* in the proxied connection.

*/
static int
-proxy_connection_io_dispatch(struct proxy_connecti= on *pc, const int rwflags, struct event_set *es)
+proxy_connection_io_dispatch(struct proxy_conn= ection *pc, const unsigned int rwflags,
+ struct event_set *es)
{
const int max_transfer_per_iteration = =3D 10000;
struct proxy_connection *cp =3D pc->coun= terpart;
- int rwfla= gs_pc =3D pc->rwflags;
- int rwflags_cp =3D cp->rwflags;
+ unsigned int rwflags_pc =3D pc->rwflags;
+ unsigned int rwflags= _cp =3D cp->rwflags;

ASSERT(pc-&g= t;defined && cp->defined && cp->counterpart =3D=3D pc= );


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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0272b709b907545de05bfded03a= 649b259ce5af6
Gerrit-Change-Number: 1107
Gerrit-PatchSet: 11
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-MessageType: newpatchset
--oRJaJbeWKbs=--