]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
tun: move print_windows_driver() out of tun.h
authorLev Stipakov <lev@openvpn.net>
Mon, 9 Jan 2023 11:30:46 +0000 (13:30 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 9 Jan 2023 11:38:51 +0000 (12:38 +0100)
We got warnings from MinGW about function being defined
but not used when compiling modules which include tun.h.

This function is not defined as inline, so its definition
should not be in header. Since this is not a performance
critical, no need to make it inline.

Leave declaration in tun.h and move definition to tun.c.

Github: fixes OpenVPN/openvpn#215

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230109113046.1678-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25923.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit a0eb1f764df39d9447b666e5a2cbd3aa01b41983)

src/openvpn/tun.c
src/openvpn/tun.h

index a83ec9e6d9d111664641323952aaf46413e517a3..6947312e610bfa18f8cc1579aa96a4efbf28cf5d 100644 (file)
@@ -7028,6 +7028,25 @@ ipset2ascii_all(struct gc_arena *gc)
     return BSTR(&out);
 }
 
+const char *
+print_windows_driver(enum windows_driver_type windows_driver)
+{
+    switch (windows_driver)
+    {
+        case WINDOWS_DRIVER_TAP_WINDOWS6:
+            return "tap-windows6";
+
+        case WINDOWS_DRIVER_WINTUN:
+            return "wintun";
+
+        case WINDOWS_DRIVER_DCO:
+            return "ovpn-dco";
+
+        default:
+            return "unspecified";
+    }
+}
+
 #else /* generic */
 
 void
index 24d5267036957e8b350ecf2c1edf80db307472eb..ed22770a0ba232c5355f656d3da80e7fe4a2814a 100644 (file)
@@ -661,24 +661,8 @@ tuntap_is_dco_win_timeout(struct tuntap *tt, int status)
     return tuntap_is_dco_win(tt) && (status < 0) && (openvpn_errno() == ERROR_NETNAME_DELETED);
 }
 
-static const char *
-print_windows_driver(enum windows_driver_type windows_driver)
-{
-    switch (windows_driver)
-    {
-        case WINDOWS_DRIVER_TAP_WINDOWS6:
-            return "tap-windows6";
-
-        case WINDOWS_DRIVER_WINTUN:
-            return "wintun";
-
-        case WINDOWS_DRIVER_DCO:
-            return "ovpn-dco";
-
-        default:
-            return "unspecified";
-    }
-}
+const char *
+print_windows_driver(enum windows_driver_type windows_driver);
 
 #else  /* ifdef _WIN32 */