From patchwork Wed Mar 24 11:23:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1655 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.27.255.52]) by backend30.mail.ord1d.rsapps.net with LMTP id ALJlBhy8W2AiQgAAIUCqbw (envelope-from ) for ; Wed, 24 Mar 2021 18:24:28 -0400 Received: from proxy11.mail.iad3a.rsapps.net ([172.27.255.52]) by director10.mail.ord1d.rsapps.net with LMTP id 8H7qBRy8W2DjKgAApN4f7A (envelope-from ) for ; Wed, 24 Mar 2021 18:24:28 -0400 Received: from smtp19.gate.iad3a ([172.27.255.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.iad3a.rsapps.net with LMTPS id AKwHARy8W2A5GQAAxCvdqw (envelope-from ) for ; Wed, 24 Mar 2021 18:24:28 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp19.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: b1875f3a-8cef-11eb-941e-5254005d39f2-1-1 Received: from [216.105.38.7] ([216.105.38.7:50004] helo=lists.sourceforge.net) by smtp19.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 06/45-04446-B1CBB506; Wed, 24 Mar 2021 18:24:27 -0400 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.90_1) (envelope-from ) id 1lPBue-0000yx-He; Wed, 24 Mar 2021 22:23:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPBud-0000yj-4Y for openvpn-devel@lists.sourceforge.net; Wed, 24 Mar 2021 22:23:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=eLt5kI/BHYme1Fa6GGXnA+Y4prMK9FT8D4wW591kl/E=; b=TJ466Hz6GN9qexk2egw+oNxl0A uL2Gmh2Yg91aUHxrS+2epoh3GtAOG+n43LvEnHrhd7NLLeGFwU52tS1wyJ4+A7Xi1SXejj3ONfn4c OfwvxmsNqzWT5xTlDhTamdPeiK4kdw0GD/qCVhAGPiGjSUPxl6cDctQt3kRlaCW/6IB0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding: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=eLt5kI/BHYme1Fa6GGXnA+Y4prMK9FT8D4wW591kl/E=; b=RbAE6WpnplNLWq2ovzAO1voL2/ r5age+JnZjEAhvSd0i6hiXr6kKpEWBrgOTO5avpn/kbw4TNME5jzPcELssGGIJDoIoZ0MLWU0bmjT 8iCRmguHYe5vzt2Haa78xwNyqFhE/D69DVUQe2YA/2Zvvv3XasyUv40TZTGiwzwgVhEA=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lPBub-0003Yj-HT for openvpn-devel@lists.sourceforge.net; Wed, 24 Mar 2021 22:23:39 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lPBuV-000ExI-4U for openvpn-devel@lists.sourceforge.net; Wed, 24 Mar 2021 23:23:31 +0100 Received: (nullmailer pid 514 invoked by uid 10006); Wed, 24 Mar 2021 22:23:31 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 24 Mar 2021 23:23:28 +0100 Message-Id: <20210324222330.455-2-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210324222330.455-1-arne@rfc2549.org> References: <20210324222330.455-1-arne@rfc2549.org> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lPBub-0003Yj-HT Subject: [Openvpn-devel] [PATCH 2/4] Fix unchecked signess conversions reported by MSVC 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Whenever possible the types have been aligned in the various parts of OpenVPN. If that was not possible, an explicit cast to a narrower type has been added. Signed-off-by: Arne Schwabe --- src/openvpn/console_builtin.c | 2 +- src/openvpn/dhcp.c | 2 +- src/openvpn/multi.h | 2 +- src/openvpn/options.h | 2 +- src/openvpn/packet_id.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openvpn/console_builtin.c b/src/openvpn/console_builtin.c index 445928bf..74a0e2b6 100644 --- a/src/openvpn/console_builtin.c +++ b/src/openvpn/console_builtin.c @@ -74,7 +74,7 @@ get_console_input_win32(const char *prompt, const bool echo, char *input, const if (in != INVALID_HANDLE_VALUE && err != INVALID_HANDLE_VALUE && !win32_service_interrupt(&win32_signal) - && WriteFile(err, prompt, strlen(prompt), &len, NULL)) + && WriteFile(err, prompt, (DWORD)strlen(prompt), &len, NULL)) { bool is_console = (GetFileType(in) == FILE_TYPE_CHAR); DWORD flags_save = 0; diff --git a/src/openvpn/dhcp.c b/src/openvpn/dhcp.c index c19370eb..1e79ccc4 100644 --- a/src/openvpn/dhcp.c +++ b/src/openvpn/dhcp.c @@ -113,7 +113,7 @@ do_extract(struct dhcp *dhcp, int optlen) const int owlen = len + 2; /* len of data to overwrite */ uint8_t *src = dest + owlen; uint8_t *end = p + optlen; - const int movlen = end - src; + const size_t movlen = end - src; if (movlen > 0) { memmove(dest, src, movlen); /* overwrite router option */ diff --git a/src/openvpn/multi.h b/src/openvpn/multi.h index 7669508c..65f64659 100644 --- a/src/openvpn/multi.h +++ b/src/openvpn/multi.h @@ -181,7 +181,7 @@ struct multi_context { struct mroute_addr local; bool enable_c2c; int max_clients; - int tcp_queue_limit; + unsigned int tcp_queue_limit; int status_file_version; int n_clients; /* current number of authenticated clients */ diff --git a/src/openvpn/options.h b/src/openvpn/options.h index f3208c71..d8e91fbc 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -457,7 +457,7 @@ struct options bool ccd_exclusive; bool disable; int n_bcast_buf; - int tcp_queue_limit; + unsigned int tcp_queue_limit; struct iroute *iroutes; struct iroute_ipv6 *iroutes_ipv6; /* IPv6 */ bool push_ifconfig_defined; diff --git a/src/openvpn/packet_id.h b/src/openvpn/packet_id.h index 3b58da22..0d2e094d 100644 --- a/src/openvpn/packet_id.h +++ b/src/openvpn/packet_id.h @@ -316,7 +316,7 @@ packet_id_close_to_wrapping(const struct packet_id_send *p) static inline bool check_timestamp_delta(time_t remote, unsigned int max_delta) { - unsigned int abs; + time_t abs; const time_t local_now = now; if (local_now >= remote)