From patchwork Mon Nov 11 00:50:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 910 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id aBe1JbBLyV1QUQAAIUCqbw for ; Mon, 11 Nov 2019 06:53:20 -0500 Received: from proxy4.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id +CuEJbBLyV2yfgAAovjBpQ ; Mon, 11 Nov 2019 06:53:20 -0500 Received: from smtp27.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy4.mail.ord1d.rsapps.net with LMTP id UM4vJbBLyV3TbwAAiYrejw ; Mon, 11 Nov 2019 06:53:20 -0500 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: smtp27.gate.ord1d.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; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: dad9a2ee-0479-11ea-bec8-5254003773d7-1-1 Received: from [216.105.38.7] ([216.105.38.7:60720] helo=lists.sourceforge.net) by smtp27.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id AC/3A-13446-0BB49CD5; Mon, 11 Nov 2019 06:53:20 -0500 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.90_1) (envelope-from ) id 1iU8Ey-0005gU-8A; Mon, 11 Nov 2019 11:52:16 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iU8Ew-0005gJ-UT for openvpn-devel@lists.sourceforge.net; Mon, 11 Nov 2019 11:52:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=k5VwV9undNu29MRfNh5zcM2PL73cKUg5o53eUbXIi0w=; b=IQAR71fwtCSLogqE1ss8PVb+kF UB/YjWWqAIBXAIG9PkouBe29MVD2ChMBYXX7Kx+5+rsR3/xIn8+Xkc3jJNSgo0F5hEb0OgQtfMwjv VWz1pqCGNR0ijBtZT+qwtz7ObFmWAB+11TBh47Rrg1X5/bsJ10jwOjkY0xrVo/fSIAlE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=k5VwV9undNu29MRfNh5zcM2PL73cKUg5o53eUbXIi0w=; b=CWuGlPPalkGwhqt1xAu8xPHUCX PVjnV8zsfCK4/bFEfhMTkzRj11T2O/Hhvlp2S5hSCymVlNhf35C6FgKNz5H1eJJ9xnZdwli9WWYV2 zUBOJsO5m5xnk+WX0F5vY4oE3zGNS2iIXrJNHbweQaAeXpIsetoTQH778vOvNr7B+/mM=; Received: from mail-lj1-f174.google.com ([209.85.208.174]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iU8Eu-00BsJe-Ns for openvpn-devel@lists.sourceforge.net; Mon, 11 Nov 2019 11:52:14 +0000 Received: by mail-lj1-f174.google.com with SMTP id p18so13447850ljc.6 for ; Mon, 11 Nov 2019 03:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=k5VwV9undNu29MRfNh5zcM2PL73cKUg5o53eUbXIi0w=; b=B7UU85FqHzp6NqPzPEYdWV4mtGMZLxdQiazn4jj16DJkNJ0qWsjIxgpP142yY0IUNk qPoz3h/ZpcvgBFLvNtzkUf7H20DUj2HAaaUxgAOH2rplqEdt9jteksVVG3uSIlXvZkpk uR4lvdNa4fgfDm0eUa7j8xwOLnJOLWyDKt/WbXsdbuobGn6xwawUdwPPa+JC2eUMUGMt 9KglpbGQqvh/Pn8CB/mPFJd3v7evsEf42Zx6KJMPj1kuwWO84h8X8wBVdhHMvpohlrWR xheSJLlk6MFlqg5zhTaX08iTakEhDFphtTOlpWtS1RnRJQhvuYn1Femai72enhgVwQZz weTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k5VwV9undNu29MRfNh5zcM2PL73cKUg5o53eUbXIi0w=; b=U95AKQps4Ci89K3QBSaLPKmLBo/N1ZQwKmCHhsv48BOjPnrNaaiWT2/kJ0qTSO5KEZ oIeAL31WEgQ66p5xwMZGsIYE7X2BYwUj0v0VbqEx63daUz7IID9YagAzSN0SlPFNCSTu 7KzSIKmcaTDmay6YVh8u56v13qO6EQQzEo1XX65lzFjHcZBmUlrtlP8jEm3/wYD03ckG UfFalPkc9cLjdjjipem/HxDb4G7P7iZqUMGGW9gbvzex9W4ylAYAgLyoXmQ+63NVxZbe u9zulJoHOTp07XjueI+NABc/7qLzdLFhu+S7EhnhgTQjJ2NLRXC6xm/PyNqQdp8t3k54 KPRw== X-Gm-Message-State: APjAAAV7AzcsS3jglv3oIp1Ap0zCxIk2rNyxuRxhyPlEAUKgtA3g6XOp /bOoFqcq1VhbEAPpic5EW4AbzaE5vGYddA== X-Google-Smtp-Source: APXvYqzycYvUwbLMDuZIOy9Qi+Fq1UL4rGjRrtgT1utXTD/PUz3AG96ZxhnuzeDdMKm30Ld3BvYBXw== X-Received: by 2002:a2e:8642:: with SMTP id i2mr11334161ljj.222.1573473125365; Mon, 11 Nov 2019 03:52:05 -0800 (PST) Received: from LAPTOP-4L3N7KFS.localdomain ([83.145.195.18]) by smtp.gmail.com with ESMTPSA id z21sm5957125lfg.0.2019.11.11.03.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 03:52:04 -0800 (PST) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Mon, 11 Nov 2019 13:50:25 +0200 Message-Id: <20191111115025.1121-1-lstipakov@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lstipakov[at]gmail.com) 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [83.145.195.18 listed in zen.spamhaus.org] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.174 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.174 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1iU8Eu-00BsJe-Ns Subject: [Openvpn-devel] [PATCH] msvc: fix various level2 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: , Cc: Lev Stipakov MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Lev Stipakov This also sets warnings level to level2, which makes them manageable. Signed-off-by: Lev Stipakov --- src/compat/Debug.props | 1 - src/openvpn/block_dns.c | 3 --- src/openvpn/buffer.c | 2 +- src/openvpn/crypto_openssl.c | 2 +- src/openvpn/init.c | 2 +- src/openvpn/mtu.c | 4 ++-- src/openvpn/openvpn.vcxproj | 20 ++++++++++---------- src/openvpn/options.c | 2 +- src/openvpn/route.c | 2 +- src/openvpn/ssl_backend.h | 2 +- src/openvpn/tun.c | 4 ++-- 11 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/compat/Debug.props b/src/compat/Debug.props index e5e9f681..31bb9d91 100644 --- a/src/compat/Debug.props +++ b/src/compat/Debug.props @@ -15,7 +15,6 @@ _DEBUG;%(PreprocessorDefinitions) MultiThreadedDebugDLL EditAndContinue - true diff --git a/src/openvpn/block_dns.c b/src/openvpn/block_dns.c index 889d6bb9..f4718fc2 100644 --- a/src/openvpn/block_dns.c +++ b/src/openvpn/block_dns.c @@ -109,9 +109,6 @@ DEFINE_GUID( static WCHAR *FIREWALL_NAME = L"OpenVPN"; -VOID NETIOAPI_API_ -InitializeIpInterfaceEntry(PMIB_IPINTERFACE_ROW Row); - /* * Default msg handler does nothing */ diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index 8575e295..b32bc8b2 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -474,7 +474,7 @@ x_gc_freespecial(struct gc_arena *a) } void -gc_addspecial(void *addr, void (free_function)(void *), struct gc_arena *a) +gc_addspecial(void *addr, void (*free_function)(void *), struct gc_arena *a) { ASSERT(a); struct gc_entry_special *e; diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index 520e40ee..1057fd1d 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -313,7 +313,7 @@ show_available_ciphers(void) } } - qsort(cipher_list, num_ciphers, sizeof(*cipher_list), cipher_name_cmp); + qsort((void *)cipher_list, num_ciphers, sizeof(*cipher_list), cipher_name_cmp); for (i = 0; i < num_ciphers; i++) { diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 0bdb0a9c..2120acaa 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1778,7 +1778,7 @@ do_open_tun(struct context *c) #ifdef _WIN32 /* store (hide) interactive service handle in tuntap_options */ c->c1.tuntap->options.msg_channel = c->options.msg_channel; - msg(D_ROUTE, "interactive service msg_channel=%u", (unsigned int) c->options.msg_channel); + msg(D_ROUTE, "interactive service msg_channel=%llu", (unsigned long long) c->options.msg_channel); #endif /* allocate route list structure */ diff --git a/src/openvpn/mtu.c b/src/openvpn/mtu.c index 04868cd6..8178ff06 100644 --- a/src/openvpn/mtu.c +++ b/src/openvpn/mtu.c @@ -175,7 +175,7 @@ set_mtu_discover_type(int sd, int mtu_type, sa_family_t proto_af) #if defined(HAVE_SETSOCKOPT) && defined(IP_MTU_DISCOVER) case AF_INET: if (setsockopt - (sd, IPPROTO_IP, IP_MTU_DISCOVER, &mtu_type, sizeof(mtu_type))) + (sd, IPPROTO_IP, IP_MTU_DISCOVER, (const char *)&mtu_type, sizeof(mtu_type))) { msg(M_ERR, "Error setting IP_MTU_DISCOVER type=%d on TCP/UDP socket", mtu_type); @@ -186,7 +186,7 @@ set_mtu_discover_type(int sd, int mtu_type, sa_family_t proto_af) #if defined(HAVE_SETSOCKOPT) && defined(IPV6_MTU_DISCOVER) case AF_INET6: if (setsockopt - (sd, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &mtu_type, sizeof(mtu_type))) + (sd, IPPROTO_IPV6, IPV6_MTU_DISCOVER, (const char *)&mtu_type, sizeof(mtu_type))) { msg(M_ERR, "Error setting IPV6_MTU_DISCOVER type=%d on TCP6/UDP6 socket", mtu_type); diff --git a/src/openvpn/openvpn.vcxproj b/src/openvpn/openvpn.vcxproj index 7446d97d..ca13fbcb 100644 --- a/src/openvpn/openvpn.vcxproj +++ b/src/openvpn/openvpn.vcxproj @@ -28,23 +28,19 @@ Application true - Unicode v142 Application - true - Unicode v142 + true Application - Unicode v142 Application - Unicode v142 @@ -74,7 +70,8 @@ ..\compat;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) _CONSOLE;%(PreprocessorDefinitions) - UNICODE;%(UndefinePreprocessorDefinitions) + %(UndefinePreprocessorDefinitions) + Level2 @@ -87,7 +84,8 @@ ..\compat;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) _CONSOLE;%(PreprocessorDefinitions) - UNICODE;%(UndefinePreprocessorDefinitions) + %(UndefinePreprocessorDefinitions) + Level2 @@ -100,7 +98,8 @@ ..\compat;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) _CONSOLE;%(PreprocessorDefinitions) - UNICODE;%(UndefinePreprocessorDefinitions) + %(UndefinePreprocessorDefinitions) + Level2 @@ -113,7 +112,8 @@ ..\compat;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) _CONSOLE;%(PreprocessorDefinitions) - UNICODE;%(UndefinePreprocessorDefinitions) + %(UndefinePreprocessorDefinitions) + Level2 @@ -303,4 +303,4 @@ - + \ No newline at end of file diff --git a/src/openvpn/options.c b/src/openvpn/options.c index c282b582..ea5e3279 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -7172,7 +7172,7 @@ add_option(struct options *options, #ifdef _WIN32 VERIFY_PERMISSION(OPT_P_GENERAL); HANDLE process = GetCurrentProcess(); - HANDLE handle = (HANDLE) atoi(p[1]); + HANDLE handle = (HANDLE) atoll(p[1]); if (!DuplicateHandle(process, handle, process, &options->msg_channel, 0, FALSE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) { diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 97e90e56..2e2216c5 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -2825,7 +2825,7 @@ get_default_gateway_ipv6(struct route_ipv6_gateway_info *rgi6, DestinationAddress.Ipv6.sin6_addr = *dest; } - status = GetBestInterfaceEx( &DestinationAddress, &BestIfIndex ); + status = GetBestInterfaceEx((struct sockaddr *)&DestinationAddress, &BestIfIndex ); if (status != NO_ERROR) { diff --git a/src/openvpn/ssl_backend.h b/src/openvpn/ssl_backend.h index 1c244ece..a241a32e 100644 --- a/src/openvpn/ssl_backend.h +++ b/src/openvpn/ssl_backend.h @@ -529,7 +529,7 @@ void print_details(struct key_state_ssl *ks_ssl, const char *prefix); void show_available_tls_ciphers_list(const char *cipher_list, const char *tls_cert_profile, - bool tls13); + const bool tls13); /* * Show the available elliptic curves in the crypto library diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 37bf065b..ebfeee4e 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -4613,7 +4613,7 @@ static DWORD get_adapter_index_method_1(const char *guid) { DWORD index; - ULONG aindex; + ULONG aindex = 0; wchar_t wbuf[256]; openvpn_swprintf(wbuf, SIZE(wbuf), L"\\DEVICE\\TCPIP_%S", guid); if (GetAdapterIndex(wbuf, &aindex) != NO_ERROR) @@ -5868,7 +5868,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun /* get driver MTU */ if (!tt->wintun) { - ULONG mtu; + ULONG mtu = 0; if (DeviceIoControl(tt->hand, TAP_WIN_IOCTL_GET_MTU, &mtu, sizeof(mtu), &mtu, sizeof(mtu), &len, NULL))