]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix '--dev null'
authorGert Doering <gert@greenie.muc.de>
Fri, 24 Feb 2017 13:52:22 +0000 (14:52 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 24 Feb 2017 19:09:50 +0000 (20:09 +0100)
To test whether a server is reachable and all the key handling is
right, openvpn can connect with "--dev null --ifconfig-noexec" to
avoid needing to the client with elevated privileges.

This was erroring out for no good reason (because the "set environment
variables appropriately" code didn't know if this is a tun or tap
device...) - treat --dev null as "tap", done.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170224135222.44640-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14186.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c

index 31585b325ea999b3b4019693c14d861d79e73230..3504fbf465350afae08e525fc304ea3e06821af7 100644 (file)
@@ -560,7 +560,9 @@ is_tun_p2p(const struct tuntap *tt)
 {
     bool tun = false;
 
-    if (tt->type == DEV_TYPE_TAP || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET))
+    if (tt->type == DEV_TYPE_TAP
+          || (tt->type == DEV_TYPE_TUN && tt->topology == TOP_SUBNET)
+          || tt->type == DEV_TYPE_NULL )
     {
         tun = false;
     }