From patchwork Fri Sep 26 14:24:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4454 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:7505:b0:72f:f16c:e055 with SMTP id r5csp787068mai; Fri, 26 Sep 2025 07:24:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXx1N7UjyYPlKvptgofTMFaSZVK0m4Pj1UGb1EpHxjiroURXNFMvyawYz/cHz+huiNjC5jq6M0bcV8=@openvpn.net X-Google-Smtp-Source: AGHT+IHgVUTM5QJcwQbUmvb7JHGp85jcYjsZKKtyRrO0e31h+a/OV+S9CGp4UWLII50Koqonc3/L X-Received: by 2002:a05:6808:11d1:b0:43f:293b:188d with SMTP id 5614622812f47-43f4cda4687mr4642493b6e.17.1758896697527; Fri, 26 Sep 2025 07:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1758896697; cv=none; d=google.com; s=arc-20240605; b=a9aEYYoPJA4Kj/SeoBGI5OW3T2v/SU6bkeTvSNp884aTvzTbh93hxxQPeaY+PPJgI/ yYbuZ0hLvOkg/IZmEinCsGxk+FZe7MGLtnTQVimnOLCRAHVbxYSdPDlz3kzUp51dpwiu aRKFJgNy0dgY5yjGyLfvxSizPulKt68wkkAb7X7LrJahwnHrTEl6LNPgst+eFTGS/dLF zt3WHWtTTlKIEPgwm04UYSwIlEBuOzGALKjoj4Ed3+E0ou2a7NhdsT7Ham7GSJ/ZH09O tQMi4b24MLAZC5GUw++WpaxxYkLMdUdMqvSbHd3weeYECkrq/M0ehJ8jOB69HjDxYRb5 GKxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=DmwtEORWy4/VlfUL7Dy50hj4RYOecy6VfggHmSL7hyE=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=NHDkWMJDKYu6wRhujOr4d98CNO49okT3HBO0vxPbrKofUSM6egRmv4Gxme/yek1TF0 JB2Fb19M+lUCigkOEdBNnkJRpQNFCqW5cPxEDNrTll/XxaJUSrANvz0TDKpiNfq3oVEG Ub4+8c/3DJXh5xXs4PQZkDsRiEPC69ACkKk4U/3jIMGhSwA8zuR5ZcohfEOe4YiTUpz/ pvMbziHZkz4Tml0dq39Czob0xlmkoU7Ay3+W6Jf4Io+vfnajaOP/N5Y7fmBlUBE8j2+M k1JraXcA/ENgWNXm6koFbk6/AGXOeUpUZ89Cgl46yuXKKZr0CTn4CDWtjcsJ4K94NNvG R7Uw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=YOuP6SZu; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=F6QJAPwG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="X4zhi/mI"; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5614622812f47-43f5113e78fsi909755b6e.104.2025.09.26.07.24.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2025 07:24:57 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=YOuP6SZu; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=F6QJAPwG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="X4zhi/mI"; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DmwtEORWy4/VlfUL7Dy50hj4RYOecy6VfggHmSL7hyE=; b=YOuP6SZuTiSWOn5E4PJGclhZdI uI/Xqb1cW62Or78jAXBDGVbTUQtQ6B6+U43TvD8Bcr9quEoD/cXCeQ9WlQzrTtrcfYNarJ0o5UmKI C88TYohpq9pUcFsBBaaW1kiqg4oCkvDUhH5yLqbfCPtkYMcwugofXtRKkcl4FEer20W8=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v29NT-0001sH-9y; Fri, 26 Sep 2025 14:24:52 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v29NS-0001s3-8C for openvpn-devel@lists.sourceforge.net; Fri, 26 Sep 2025 14:24:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=td3C8pUqIWH6hzE/uVBiWYIHLCsvGM+vPCX8aiGrTio=; b=F6QJAPwGGRQ7H8lCVjD74W5qt+ YemPA8M1D27sW2BN/NwPV7q3Ca2P/VmWQaMwwinjktD5X/LX8jvM2fnuMtbGGhrS3m8cGzroggqJM SjyzR+qU1L7ppr9MfzfBr4lQJpPQEo9gGNmLCIWCeqzGXAIOmZELQHVl19VYhPWY/mn4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=td3C8pUqIWH6hzE/uVBiWYIHLCsvGM+vPCX8aiGrTio=; b=X4zhi/mIq3uf+18KmHkNz9bg+q P4uHvdti+/3CjpOcTQTQQDser9hpfFY3wipe0rkMs3857i8tvvcCb1fKLdeGIW/SSzALtlLaQR1ZF x8QHpQ0TZeCZEUMD/jev20DKoEAcbHxpBJkNeTW2bg9WXB7S50XoIJxKTWi2fgnESNag=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v29NR-0006Ud-UH for openvpn-devel@lists.sourceforge.net; Fri, 26 Sep 2025 14:24:50 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 58QEOgFP020816 for ; Fri, 26 Sep 2025 16:24:42 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 58QEOgWs020815 for openvpn-devel@lists.sourceforge.net; Fri, 26 Sep 2025 16:24:42 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 26 Sep 2025 16:24:36 +0200 Message-ID: <20250926142442.20796-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld 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 [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [193.149.48.134 listed in list.dnswl.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1v29NR-0006Ud-UH Subject: [Openvpn-devel] [PATCH v1] dco_linux: Fix -Wconversion warnings X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1844336863767633607?= X-GMAIL-MSGID: =?utf-8?q?1844336863767633607?= From: Frank Lichtenheld 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 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1220 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli 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) */