]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
wintun: check for conflicting options
authorSimon Rozman <simon@rozman.si>
Wed, 5 Feb 2020 18:49:22 +0000 (19:49 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 8 Mar 2020 19:56:58 +0000 (20:56 +0100)
`--windows-driver wintun` requires `--dev tun`. This is now checked and
documented.

Signed-off-by: Simon Rozman <simon@rozman.si>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20200205184922.883-1-simon@rozman.si>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19368.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/openvpn.8
src/openvpn/options.c

index d631ebe7f8e67bbe619c028decc1ac3793b54a75..864f94e8e8b54cfdca1bb0bd02ae68a8b3ebbc8b 100644 (file)
@@ -6265,6 +6265,10 @@ Specifies which tun driver to use. Values are
 (default) and
 .B wintun.
 This is Windows-only option.
+"wintun" requires
+.B \-\-dev tun
+and the OpenVPN process to run elevated, or be invoked using
+the Interactive Service.
 .\"*********************************************************
 .TP
 .B \-\-dhcp\-renew
index 6c0e52e62df24b5447f9e2e0e2b4363de96a65aa..842f4142cd47f95d5dc585221548f3e6c0863e7c 100644 (file)
@@ -2204,7 +2204,12 @@ options_postprocess_verify_ce(const struct options *options, const struct connec
     {
         msg(M_USAGE, "--dhcp-options requires --ip-win32 dynamic or adaptive");
     }
-#endif
+
+    if (options->windows_driver == WINDOWS_DRIVER_WINTUN && dev != DEV_TYPE_TUN)
+    {
+        msg(M_USAGE, "--windows-driver wintun requires --dev tun");
+    }
+#endif /* ifdef _WIN32 */
 
     /*
      * Check that protocol options make sense.