From patchwork Tue Feb 7 13:43:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3056 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp3963246dyk; Tue, 7 Feb 2023 05:44:35 -0800 (PST) X-Google-Smtp-Source: AK7set9BdcXSoN33/cMUh3AmX8SNvfi2R/TECmdHgPo6F+FmEZM95NiiKTxMiBtwfVU1uXEkxGoz X-Received: by 2002:a1f:eec6:0:b0:400:c69b:80f3 with SMTP id m189-20020a1feec6000000b00400c69b80f3mr1278548vkh.7.1675777475261; Tue, 07 Feb 2023 05:44:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675777475; cv=none; d=google.com; s=arc-20160816; b=gqgrxGkHTJYmT8FwBHsn0IgKApuP37bIiPiZ0nI5u1Rx2UcTwsKu+WKRgX9kvxaDHw 6m9xRoR0P/mK6emTLaIuigVidwvgqvIP/LPaQI+fgh6VcDn3X4xAUNKnyTUyRKdjcAzI rtKl3DEZOdl9QyZkf9wd66uzRY8BVHcrCZKW5te59Euo851WKMnFnL956bUit9VYhm5L QvLhddeQSZ0FotjOzfwyz+/rPmE/JqkuROWovTE/6YRuUgP3jIxs3QTAe2rJrjVetcUn i4VptW2n5e3Husm9b1eVMqV3Xs1EbdNcunc7qiAz8IjjCSozbVT2hPrOKnzyI1zuz8Ax UIuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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; bh=MkD2G6pmjwwAgsupT9qRR26yKJFrEm0pacm5/pI60DY=; b=gMC6iOtxwyuIsrWLqZmrXM2rcKviISDR2AGSPWzsUZUSaG1zSp75eYT85rFVMB3+JQ dc8KPj40Ai2X33eoUoj83mbvbBFFPaicKh5fXZOET1lY1NwSpQygv29raECjeuxIxfui ueVIj6opzFCi3fQl3tXWbfnKBhP4tv85FwUK32eNB40Klu3SsUnMTIaQKVPgjm5E9wSW p8FYa2N28Q/YESQmcq4k2ts9N8zV3bXb8y2oVgSo6ufTn0JvQ6pHYSBAGAsWWSQLYu7r qfOlL/1l8ZQty+G0h8HS4AePXzq7N7qKasVTtkLPhFKywBc3kxE829g6sdvOjQ0U4469 wd2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=CRvu4wzG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=G7TmvY5s; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id k9-20020a056102116900b00411aaa1acc0si213937vsg.415.2023.02.07.05.44.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2023 05:44:35 -0800 (PST) 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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=CRvu4wzG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=G7TmvY5s; 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 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pPOGD-0003fX-0x; Tue, 07 Feb 2023 13:43:48 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pPOGA-0003fH-Po for openvpn-devel@lists.sourceforge.net; Tue, 07 Feb 2023 13:43:46 +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=gh6LF87j4+TfJm7imRykaVD7Q45il8jX+IVeGF24rjY=; b=CRvu4wzGpzJtTsEIa0NTuPnBDj 34XqfUaCoXnBgdHuAyhUKDXkOYenhkMwko1AXXMK3lHn7vNvwI90H/jeezLsA1wchKl/D+NBbro+Y tRzesAjzMesBmIJHTQ/vxL0GaO45+jv0LStSR61uUqPFXYrDEbZYjwTDVYxTQsTBRfXo=; 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=gh6LF87j4+TfJm7imRykaVD7Q45il8jX+IVeGF24rjY=; b=G7TmvY5sVFMH+TCd1X3bHhJM2/ V4n0Szu0u5zELJ1TwoIe2lmRnrz4T2WvN4TPdIHi1EktLpKN4++DseuHl7JSRf6/YoffMCZoS5LVq 7Uqg1WyKBDYWG0WH3BOa2FYhMNX7HKN6L9L5K2wsXyvYgL5ctdexIoJ4DwMrcNnoFYMI=; Received: from mout-p-202.mailbox.org ([80.241.56.172]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pPOG7-0002Ty-8a for openvpn-devel@lists.sourceforge.net; Tue, 07 Feb 2023 13:43:45 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PB48l3FV6z9scq for ; Tue, 7 Feb 2023 14:43:35 +0100 (CET) From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Feb 2023 14:43:33 +0100 Message-Id: <20230207134333.52221-1-frank@lichtenheld.com> In-Reply-To: <20230203191440.136050-4-frank@lichtenheld.com> References: <20230203191440.136050-4-frank@lichtenheld.com> MIME-Version: 1.0 X-Spam-Score: -0.7 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", 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: Relevant defines/typedefs: typedef UINT_PTR SOCKET; if defined(_WIN64) typedef unsigned __int64 UINT_PTR; else typedef unsigned int UINT_PTR; endif ifdef _WIN64 define PRIuPTR PRIu64 else define PRIuP [...] Content analysis details: (-0.7 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.172 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pPOG7-0002Ty-8a Subject: [Openvpn-devel] [PATCH v2 3/5] Windows: fix wrong printf format in x_check_status 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?1756838464263155759?= X-GMAIL-MSGID: =?utf-8?q?1757180041730794251?= Relevant defines/typedefs: typedef UINT_PTR SOCKET; if defined(_WIN64) typedef unsigned __int64 UINT_PTR; else typedef unsigned int UINT_PTR; endif ifdef _WIN64 define PRIuPTR PRIu64 else define PRIuPTR PRIu32 endif Remove duplicated include of inttypes.h Signed-off-by: Frank Lichtenheld Acked-by: Lev Stipakov --- src/openvpn/error.c | 4 ++-- src/openvpn/syshead.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) v2: - use PRIuPTR as discussed on IRC (added relevant defines to commit message) - remove redundant include for inttypes.h from syshead.h diff --git a/src/openvpn/error.c b/src/openvpn/error.c index 89a08cec..a2c9aa4c 100644 --- a/src/openvpn/error.c +++ b/src/openvpn/error.c @@ -695,14 +695,14 @@ x_check_status(int status, { if (extended_msg) { - msg(x_cs_info_level, "%s %s [%s]: %s (fd=%d,code=%d)", description, + msg(x_cs_info_level, "%s %s [%s]: %s (fd=" SOCKET_PRINTF ",code=%d)", description, sock ? proto2ascii(sock->info.proto, sock->info.af, true) : "", extended_msg, openvpn_strerror(my_errno, crt_error, &gc), sock ? sock->sd : -1, my_errno); } else { - msg(x_cs_info_level, "%s %s: %s (fd=%d,code=%d)", description, + msg(x_cs_info_level, "%s %s: %s (fd=" SOCKET_PRINTF ",code=%d)", description, sock ? proto2ascii(sock->info.proto, sock->info.af, true) : "", openvpn_strerror(my_errno, crt_error, &gc), sock ? sock->sd : -1, my_errno); diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index fe91bc11..12ccf2f4 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -48,7 +48,6 @@ #ifdef _MSC_VER /* Visual Studio */ #define __func__ __FUNCTION__ #define __attribute__(x) -#include #endif #if defined(__APPLE__) @@ -442,9 +441,11 @@ typedef unsigned short sa_family_t; */ #ifdef _WIN32 #define SOCKET_UNDEFINED (INVALID_SOCKET) +#define SOCKET_PRINTF "%" PRIuPTR typedef SOCKET socket_descriptor_t; #else #define SOCKET_UNDEFINED (-1) +#define SOCKET_PRINTF "%d" typedef int socket_descriptor_t; #endif