[Openvpn-devel] wintun: check for conflicting options

Message ID 20200205184922.883-1-simon@rozman.si
State Accepted
Headers show
Series [Openvpn-devel] wintun: check for conflicting options | expand

Commit Message

Simon Rozman Feb. 5, 2020, 7:49 a.m. UTC
`--windows-driver wintun` requires `--dev tun`. This is now checked and
documented.

Signed-off-by: Simon Rozman <simon@rozman.si>
---
 doc/openvpn.8         | 4 ++++
 src/openvpn/options.c | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

Comments

Lev Stipakov Feb. 5, 2020, 8:23 a.m. UTC | #1
Makes sense.

Compiled, tested.

Acked-by: Lev Stipakov <lstipakov@gmail.com>
<div dir="ltr"><div dir="ltr">Makes sense.<div><br></div><div>Compiled, tested.</div><div><br></div><div>Acked-by: Lev Stipakov &lt;<a href="mailto:lstipakov@gmail.com">lstipakov@gmail.com</a>&gt;</div></div></div>
Gert Doering March 8, 2020, 8:55 a.m. UTC | #2
Your patch has been applied to the master branch.

Indeed, check makes sense :-) - compile tested on Ubuntu 16 / MinGW.

commit 05ce4563fbea51a2653a6aa1ee51154ae6b7c6a0
Author: Simon Rozman
Date:   Wed Feb 5 19:49:22 2020 +0100

     wintun: check for conflicting options

     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>


--
kind regards,

Gert Doering
Gert Doering March 8, 2020, 8:58 a.m. UTC | #3
Hi,

On Sun, Mar 08, 2020 at 08:55:37PM +0100, Gert Doering wrote:
> Your patch has been applied to the master branch.
> 
> Indeed, check makes sense :-) - compile tested on Ubuntu 16 / MinGW.
> 
> commit 05ce4563fbea51a2653a6aa1ee51154ae6b7c6a0

*sigh*

I forgot to pull & rebase before applying Simon's and Lev's 4 patches,
and at push time, git told me...

So the commits for those 4 patches are all wrong.


Here are the commit IDs after rebasing, which I am going to push now:

commit 53e7d8dba4f3d0a0c54641ad5e94acf060e352da (HEAD -> master)
Author: Simon Rozman <simon@rozman.si>
Date:   Wed Feb 5 19:49:22 2020 +0100

    wintun: check for conflicting options

commit baef44fc8769bbd99f4d699ce9f63180c29a5455
Author: Simon Rozman <simon@rozman.si>
Date:   Wed Feb 5 18:59:44 2020 +0100

    tun.c: uncrustify

commit 4c71a647c460e276b81476a409143b97f01a03cc
Author: Simon Rozman <simon@rozman.si>
Date:   Wed Feb 5 18:55:56 2020 +0100

    tun.c: refactor driver detection and make it case-insensitive
    
commit b111aa8006ae39f5ca9cf251d158d5850806f536
Author: Lev Stipakov <lev@openvpn.net>
Date:   Sat Feb 29 14:35:15 2020 +0200

    interactive.c: remove unused function
    

Apologies.

gert

Patch

diff --git a/doc/openvpn.8 b/doc/openvpn.8
index 8feb3b9c..e2227a47 100644
--- a/doc/openvpn.8
+++ b/doc/openvpn.8
@@ -6257,6 +6257,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 c459b260..101cca38 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.