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/+/1220?usp=email
to review the following change.
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 <[email protected]>
---
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/1
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 = nlmsg_alloc();
if (!nl_msg)
@@ -346,7 +341,7 @@
if (!(nlh->nlmsg_flags & NLM_F_CAPPED))
{
- ack_len += err->msg.nlmsg_len - sizeof(*nlh);
+ ack_len += err->msg.nlmsg_len - (int)sizeof(*nlh);
}
if (len <= ack_len)
@@ -360,8 +355,8 @@
nla_parse(tb_msg, OVPN_NLMSGERR_ATTR_MAX, attrs, len, NULL);
if (tb_msg[NLMSGERR_ATTR_MSG])
{
- len = strnlen((char *)nla_data(tb_msg[NLMSGERR_ATTR_MSG]),
- nla_len(tb_msg[NLMSGERR_ATTR_MSG]));
+ len = (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[NLMSGERR_ATTR_MSG]));
}
@@ -606,7 +601,7 @@
msg(D_DCO_DEBUG, "%s: slot %d, key-id %d, peer-id %d, cipher %s",
__func__, slot, keyid, peerid,
ciphername);
- const size_t key_len = cipher_kt_key_size(ciphername);
+ const int key_len = cipher_kt_key_size(ciphername);
const int nonce_tail_len = 8;
struct nl_msg *nl_msg = 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=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I473d345d10fc406f76fbdb131c28cc4fc54822fd
Gerrit-Change-Number: 1220
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel