From 53e7d8dba4f3d0a0c54641ad5e94acf060e352da Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 5 Feb 2020 19:49:22 +0100 Subject: [PATCH] wintun: check for conflicting options `--windows-driver wintun` requires `--dev tun`. This is now checked and documented. Signed-off-by: Simon Rozman Acked-by: Lev Stipakov 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 --- doc/openvpn.8 | 4 ++++ src/openvpn/options.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/openvpn.8 b/doc/openvpn.8 index d631ebe7f..864f94e8e 100644 --- a/doc/openvpn.8 +++ b/doc/openvpn.8 @@ -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 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 6c0e52e62..842f4142c 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -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. -- 2.47.2