From patchwork Wed Apr 21 03:43:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1757 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 8KovHG4sgGCAHwAAIUCqbw (envelope-from ) for ; Wed, 21 Apr 2021 09:45:18 -0400 Received: from proxy17.mail.ord1d.rsapps.net ([172.30.191.6]) by director14.mail.ord1d.rsapps.net with LMTP id cJ/oG24sgGD0RgAAeJ7fFg (envelope-from ) for ; Wed, 21 Apr 2021 09:45:18 -0400 Received: from smtp23.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy17.mail.ord1d.rsapps.net with LMTPS id EDWpG24sgGBnUQAAWC7mWg (envelope-from ) for ; Wed, 21 Apr 2021 09:45:18 -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: smtp23.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; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: cea120d8-a2a7-11eb-a607-525400bfb165-1-1 Received: from [216.105.38.7] ([216.105.38.7:54366] helo=lists.sourceforge.net) by smtp23.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 2C/88-12012-D6C20806; Wed, 21 Apr 2021 09:45:18 -0400 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.92.3) (envelope-from ) id 1lZD9a-0002h4-RM; Wed, 21 Apr 2021 13:44:30 +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.92.3) (envelope-from ) id 1lZD9A-0002fE-Of for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 13:44:04 +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=MzftlywwtqX4zBHkrx8uiyoomdRoLfhhG5SGZuRiT6Q=; b=dseJJ2Vaf1HWGEUA6TXbM07Tba 31KSW1FRNY0tkGzCAmQwTWcYlBRsXS160MOC84IU3ZHiunK0DLF6s9yKQplAfXq9RDCHJpQjliSCy bN27cG7+u4otNzMs7iEtisbXlIW8DkwVFk47BaS18J+pRcz85Kn9j6DqfMm4hqNoiNQM=; 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=MzftlywwtqX4zBHkrx8uiyoomdRoLfhhG5SGZuRiT6Q=; b=fqhYDnBOGexZoFsxYsxFmhsP2O QuIllkLcrkq4n/fn6USp1BzPhwonieciMUhoa2FdhP/2C0cG9bXIliLEqIFxjxGKls83BKo6hCoY3 kRfZ8mpvn6VRO2DLetD0TuExmRlVkjtzdov6zoL8FcHFmyxl66agR8e7bretapgB33k8=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lZD95-0088oU-CF for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 13:44:04 +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 1lZD8u-0004QR-3h for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 15:43:48 +0200 Received: (nullmailer pid 1950451 invoked by uid 10006); Wed, 21 Apr 2021 13:43:48 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 21 Apr 2021 15:43:45 +0200 Message-Id: <20210421134348.1950392-4-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210421134348.1950392-1-arne@rfc2549.org> References: <20210421134348.1950392-1-arne@rfc2549.org> MIME-Version: 1.0 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: 1lZD95-0088oU-CF Subject: [Openvpn-devel] [PATCH 4/7] Fix a number of mingw 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 Move to definition inside the ifdef where they are used to avoid unused warnings. Fix a few printf related warnings when DWORD is used as paramter and the printf format should be %lu (long unsigned int) Signed-off-by: Arne Schwabe Acked-by: Antonio Quartulli --- src/openvpn/route.c | 4 ++-- src/openvpn/socket.c | 3 ++- src/openvpn/tun.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openvpn/route.c b/src/openvpn/route.c index c6b3dc584..c83bd9e2b 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -2360,7 +2360,6 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, #else int metric; #endif - const char *device = tt->actual_name; bool gateway_needed = false; if ((r6->flags & (RT_DEFINED|RT_ADDED)) != (RT_DEFINED|RT_ADDED)) @@ -2369,6 +2368,7 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, } #ifndef _WIN32 + const char *device = tt->actual_name; if (r6->iface != NULL) /* vpn server special route */ { device = r6->iface; @@ -2713,7 +2713,7 @@ get_default_gateway_row(const MIB_IPFORWARDTABLE *routes) const DWORD index = row->dwForwardIfIndex; const DWORD metric = row->dwForwardMetric1; - dmsg(D_ROUTE_DEBUG, "GDGR: route[%d] %s/%s i=%d m=%d", + dmsg(D_ROUTE_DEBUG, "GDGR: route[%lu] %s/%s i=%d m=%d", i, print_in_addr_t((in_addr_t) net, 0, &gc), print_in_addr_t((in_addr_t) mask, 0, &gc), diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index b13d2e0f1..8a6e42cc6 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -2837,10 +2837,11 @@ print_link_socket_actual_ex(const struct link_socket_actual *act, { if (act) { - char ifname[IF_NAMESIZE] = "[undef]"; struct buffer out = alloc_buf_gc(128, gc); buf_printf(&out, "%s", print_sockaddr_ex(&act->dest.addr.sa, separator, flags, gc)); #if ENABLE_IP_PKTINFO + char ifname[IF_NAMESIZE] = "[undef]"; + if ((flags & PS_SHOW_PKTINFO) && addr_defined_ipi(act)) { switch (act->dest.addr.sa.sa_family) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 2c1b270dd..4ef34e4eb 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5606,7 +5606,7 @@ windows_set_mtu(const int iface_index, const short family, if (err != NO_ERROR) { - msg(M_WARN, "TUN: Setting %s mtu failed: %s [status=%u if_index=%d]", + msg(M_WARN, "TUN: Setting %s mtu failed: %s [status=%lu if_index=%d]", family_name, strerror_win32(err, &gc), err, iface_index); } else