summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/openvpn/init.c10
-rw-r--r--src/openvpn/options.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 3a67a50..2c3285d 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -910,7 +910,6 @@ do_genkey (const struct options * options)
bool
do_persist_tuntap (const struct options *options)
{
-#ifdef ENABLE_FEATURE_TUN_PERSIST
if (options->persist_config)
{
/* sanity check on options for --mktun or --rmtun */
@@ -926,14 +925,21 @@ do_persist_tuntap (const struct options *options)
)
msg (M_FATAL|M_OPTERR,
"options --mktun or --rmtun should only be used together with --dev");
+#ifdef ENABLE_FEATURE_TUN_PERSIST
tuncfg (options->dev, options->dev_type, options->dev_node,
options->persist_mode,
options->username, options->groupname, &options->tuntap_options);
if (options->persist_mode && options->lladdr)
set_lladdr(options->dev, options->lladdr, NULL);
return true;
- }
+#else
+ msg( M_FATAL|M_OPTERR,
+ "options --mktun and --rmtun are not available on your operating "
+ "system. Please check 'man tun' (or 'tap'), whether your system "
+ "supports using 'ifconfig %s create' / 'destroy' to create/remove "
+ "persistant tunnel interfaces.", options->dev );
#endif
+ }
return false;
}
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index dd3f1e4..496eb5d 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -7038,7 +7038,6 @@ add_option (struct options *options,
options->pkcs11_id_management = true;
}
#endif
-#ifdef ENABLE_FEATURE_TUN_PERSIST
else if (streq (p[0], "rmtun"))
{
VERIFY_PERMISSION (OPT_P_GENERAL);
@@ -7051,7 +7050,6 @@ add_option (struct options *options,
options->persist_config = true;
options->persist_mode = 1;
}
-#endif
else if (streq (p[0], "peer-id"))
{
VERIFY_PERMISSION (OPT_P_PEER_ID);