]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
tun.c on WIN32: remove more unused variables
authorSelva Nair <selva.nair@gmail.com>
Sat, 3 Apr 2021 17:24:03 +0000 (13:24 -0400)
committerGert Doering <gert@greenie.muc.de>
Sun, 4 Apr 2021 09:04:00 +0000 (11:04 +0200)
Fixes:
  tun.c: In function ‘do_ifconfig_ipv4’:
  tun.c:1217:17: warning: variable ‘ifconfig_remote_netmask’ set but not
  used [-Wunused-but-set-variable]
     const char *ifconfig_remote_netmask = NULL;

  tun.c:1213:10: warning: unused variable ‘tun’ [-Wunused-variable]
     bool tun = is_tun_p2p(tt);

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20210403172403.9452-1-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22019.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c

index 60a3a179ee3b5620d3b17b6f7d5b9f29237456ff..2385377fce3ddb4260055665bd19ff95647b7def 100644 (file)
@@ -1206,10 +1206,12 @@ static void
 do_ifconfig_ipv4(struct tuntap *tt, const char *ifname, int tun_mtu,
                  const struct env_set *es, openvpn_net_ctx_t *ctx)
 {
+#if !defined(_WIN32) && !defined(TARGET_ANDROID)
     /*
      * We only handle TUN/TAP devices here, not --dev null devices.
      */
     bool tun = is_tun_p2p(tt);
+#endif
 
 #if !defined(TARGET_LINUX)
     const char *ifconfig_local = NULL;
@@ -1533,7 +1535,7 @@ do_ifconfig_ipv4(struct tuntap *tt, const char *ifname, int tun_mtu,
         msg(M_INFO,
             "******** NOTE:  Please manually set the IP/netmask of '%s' to %s/%s (if it is not already set)",
             ifname, ifconfig_local,
-            print_in_addr_t(tt->adapter_netmask, 0, &gc));
+            ifconfig_remote_netmask);
     }
     else if (tt->options.ip_win32_type == IPW32_SET_DHCP_MASQ || tt->options.ip_win32_type == IPW32_SET_ADAPTIVE)
     {