From: "cron2 (Code Review)" Date: Fri, 26 Sep 2025 20:39:07 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., antonio@...2726... Message-ID: <4c411d354dafff6e18c9c74def8a1119fc626e5d-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="04fDNbZRVkE="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: dco_linux: Fix -Wconversion warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --04fDNbZRVkE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1220?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by ordex Change subject: dco_linux: Fix -Wconversion warnings ...................................................................... dco_linux: Fix -Wconversion warnings Combination of using the correct types and some unavoidable safe size_t->int casts. Change-Id: I473d345d10fc406f76fbdb131c28cc4fc54822fd Signed-off-by: Frank Lichtenheld Acked-by: Antonio Quartulli Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1220 Message-Id: <20250926142442.20796-1-gert@...1296...> URL: https://sourceforge.net/p/openvpn/mailman/message/59239172/ Signed-off-by: Gert Doering --- M src/openvpn/dco_linux.c 1 file changed, 5 insertions(+), 14 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/20/1220/2 diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 395a38f..d46fa46 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -62,11 +62,6 @@ typedef int (*ovpn_nl_cb)(struct nl_msg *msg, void *arg); -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /** * @brief resolves the netlink ID for ovpn-dco * @@ -110,7 +105,7 @@ } static struct nl_msg * -ovpn_dco_nlmsg_create(dco_context_t *dco, int cmd) +ovpn_dco_nlmsg_create(dco_context_t *dco, uint8_t cmd) { struct nl_msg *nl_msg =3D nlmsg_alloc(); if (!nl_msg) @@ -346,7 +341,7 @@ if (!(nlh->nlmsg_flags & NLM_F_CAPPED)) { - ack_len +=3D err->msg.nlmsg_len - sizeof(*nlh); + ack_len +=3D err->msg.nlmsg_len - (int)sizeof(*nlh); } if (len <=3D ack_len) @@ -360,8 +355,8 @@ nla_parse(tb_msg, OVPN_NLMSGERR_ATTR_MAX, attrs, len, NULL); if (tb_msg[NLMSGERR_ATTR_MSG]) { - len =3D strnlen((char *)nla_data(tb_msg[NLMSGERR_ATTR_MSG]), - nla_len(tb_msg[NLMSGERR_ATTR_MSG])); + len =3D (int)strnlen((char *)nla_data(tb_msg[NLMSGERR_ATTR_MSG]), + nla_len(tb_msg[NLMSGERR_ATTR_MSG])); msg(M_WARN, "kernel error: %*s", len, (char *)nla_data(tb_msg[NLMS= GERR_ATTR_MSG])); } @@ -606,7 +601,7 @@ msg(D_DCO_DEBUG, "%s: slot %d, key-id %d, peer-id %d, cipher %s", __fu= nc__, slot, keyid, peerid, ciphername); - const size_t key_len =3D cipher_kt_key_size(ciphername); + const int key_len =3D cipher_kt_key_size(ciphername); const int nonce_tail_len =3D 8; struct nl_msg *nl_msg =3D ovpn_dco_nlmsg_create(dco, OVPN_CMD_KEY_NEW); @@ -1303,8 +1298,4 @@ return "AES-128-GCM:AES-256-GCM:AES-192-GCM:CHACHA20-POLY1305"; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - #endif /* defined(ENABLE_DCO) && defined(TARGET_LINUX) */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1220?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: I473d345d10fc406f76fbdb131c28cc4fc54822fd Gerrit-Change-Number: 1220 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --04fDNbZRVkE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outd= ated and were removed: Code-Review+2 by ordex

dco_linux: Fix -Wconversion warnings

Combinat= ion of using the correct types and some
unavoidable safe size_t->int = casts.

Change-Id: I473d345d10fc406f76fbdb131c28cc4fc54822fd
Signe= d-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Antonio Q= uartulli <antonio@...2726...>
Gerrit URL: https://gerrit.openvpn.n= et/c/openvpn/+/1220
Message-Id: <20250926142442.20796-1-gert@...1725...= ..>
URL: https://sourceforge.net/p/openvpn/mailman/message/59239172/<= br>Signed-off-by: Gert Doering <gert@...1296...>
---
M src/open= vpn/dco_linux.c
1 file changed, 5 insertions(+), 14 deletions(-)

=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/20/1220/2
diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c
index 395a38f..d46fa46 100644
--- a/src/openvpn/= dco_linux.c
+++ b/src/openvpn/dco_linux.c
@= @ -62,11 +62,6 @@

typedef int (*ovpn_nl_= cb)(struct nl_msg *msg, void *arg);

-#if defined(__GNUC__) || defined(__clang__)=
-#pragma GCC diagnosti= c push
-#pragma GCC dia= gnostic ignored "-Wconversion"
-#endif
-
/**
* @brief resolves the netlink I= D for ovpn-dco
*
@@ -110,7 +105,7 @@
}

static struct nl_msg *
-ovpn_dco_nlmsg_create(dc= o_context_t *dco, int cmd)
+ovpn_dco_nlmsg_create(dco_context_t *dco, uint8_t cmd)
{

struct nl_msg *nl_msg =3D nlmsg_alloc();<= br> if (!nl_msg)
@@ -346,7 +341,7 @@

if (!(nlh->nlmsg_flags & NLM_F_CAPPED))
{
-= ack_len +=3D err->msg.nlmsg_len - sizeof(*nlh);
+ ack_len +=3D err->msg.nlm= sg_len - (int)sizeof(*nlh);
}
=
if (len <=3D ack_len)
@@ -360,8 +355,8 @@=
nla_parse(tb_msg, OVPN_NLMSGERR_ATTR_MAX, attrs, len,= NULL);
if (tb_msg[NLMSGERR_ATTR_MSG])
{

- len = =3D strnlen((char *)nla_data(tb_msg[NLMSGERR_ATTR_MSG]),
- nla_len(tb_msg[NLM= SGERR_ATTR_MSG]));
+ = len =3D (int)strnlen((char *)nla_data(tb_msg[NLMSGERR_ATTR_MSG]),
+ = nla_len(tb_msg[NLMSGERR_ATTR_MSG]));
msg(M_WA= RN, "kernel error: %*s", len, (char *)nla_data(tb_msg[NLMSGERR_AT= TR_MSG]));
}

@@ -606= ,7 +601,7 @@
msg(D_DCO_DEBUG, "%s: slot %d, key-i= d %d, peer-id %d, cipher %s", __func__, slot, keyid, peerid, ciphername);

- const size_t key_len =3D cipher_kt_key_size(ci= phername);
+ const= int key_len =3D cipher_kt_key_size(ciphername);
const= int nonce_tail_len =3D 8;

struct nl= _msg *nl_msg =3D ovpn_dco_nlmsg_create(dco, OVPN_CMD_KEY_NEW);
@@ -1303,8 +1298,4 @@

return "AES-128-GCM:AES= -256-GCM:AES-192-GCM:CHACHA20-POLY1305";
}
=
-#if defined(__= GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
#endif /* defined(ENABLE_DCO) && defined(TARGET_LIN= UX) */

To view, visit change 1220. To unsub= scribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I473d345d10fc406f76fbdb131c2= 8cc4fc54822fd
Gerrit-Change-Number: 1220
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--04fDNbZRVkE=--