aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn
diff options
context:
space:
mode:
authorArne Schwabe2021-04-21 15:43:45 +0200
committerGert Doering2021-04-22 16:33:23 +0200
commit7890e51aab91b304045a0163462f334b8e5ae8e8 (patch)
tree1d402f881d86de72eb0176392edf7bbdb2449a00 /src/openvpn
parent3a16a8678ded8df8e41c495bccc4e24ef0ce82f4 (diff)
downloadopenvpn-7890e51aab91b304045a0163462f334b8e5ae8e8.zip
openvpn-7890e51aab91b304045a0163462f334b8e5ae8e8.tar.gz
Fix a number of mingw warnings
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 <arne@rfc2549.org> Acked-by: Antonio Quartulli <antonio@openvpn.net> Message-Id: <20210421134348.1950392-4-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22176.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn')
-rw-r--r--src/openvpn/route.c4
-rw-r--r--src/openvpn/socket.c3
-rw-r--r--src/openvpn/tun.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index c6b3dc5..c83bd9e 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 b13d2e0..8a6e42c 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 2c1b270..4ef34e4 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