summaryrefslogtreecommitdiffstats
path: root/src/openvpn/tun.h
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2012-08-16 20:09:09 +0200
committerDavid Sommerseth <davids@redhat.com>2012-09-02 20:28:53 +0200
commit3630a7a50099874d55bf8e212ad4a97d6e70966f (patch)
tree9e7d141345c64283dd77564d5cd45f9e0a584204 /src/openvpn/tun.h
parent7f696549251d853a9f40a373501b86cc6e5301e3 (diff)
downloadopenvpn-3630a7a50099874d55bf8e212ad4a97d6e70966f.tar.gz
openvpn-3630a7a50099874d55bf8e212ad4a97d6e70966f.tar.xz
openvpn-3630a7a50099874d55bf8e212ad4a97d6e70966f.zip
Keep pre-existing tun/tap devices around on *BSD
This amends commit 62c613d46dc49 to check whether a named tun/tap device ("--dev tunX" instead of "--dev tun") exists before OpenVPN started - if yes, keep around at program end. If no, destroy. Also has a spelling fix, and changes clear_tuntap() to be "static" (only ever called from within tun.c). Tested on FreeBSD 7.4, FreeBSD 9.0, NetBSD 5.1, OpenBSD 4.9 Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Eric Crist <ecrist@secure-computing.net> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/openvpn/tun.h')
-rw-r--r--src/openvpn/tun.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h
index 9bd990f..8622bf8 100644
--- a/src/openvpn/tun.h
+++ b/src/openvpn/tun.h
@@ -137,6 +137,8 @@ struct tuntap
bool ipv6;
+ bool persistent_if; /* if existed before, keep on program end */
+
struct tuntap_options options; /* options set on command line */
char *actual_name; /* actual name of TUN/TAP dev, usually including unit number */
@@ -201,7 +203,7 @@ tuntap_defined (const struct tuntap *tt)
* Function prototypes
*/
-void clear_tuntap (struct tuntap *tuntap);
+static void clear_tuntap (struct tuntap *tuntap);
void open_tun (const char *dev, const char *dev_type, const char *dev_node,
struct tuntap *tt);