aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-09-04 13:40:35 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2013-09-12 01:44:49 +0200
commitbf32cdfbf66efb6efb2d41e0bb19207c3da8f643 (patch)
tree4c0b6b148d58e1a59850a1f6911b8b835c9d7411 /src
parent5ec08a6a05476c0fc3767f3550d8a65e49f57a16 (diff)
downloadstrongswan-bf32cdfbf66efb6efb2d41e0bb19207c3da8f643.tar.bz2
strongswan-bf32cdfbf66efb6efb2d41e0bb19207c3da8f643.tar.xz
tun_device: Add warning if TUN devices are not supported by platform
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/networking/tun_device.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/libstrongswan/networking/tun_device.c b/src/libstrongswan/networking/tun_device.c
index af7e57140..65268d242 100644
--- a/src/libstrongswan/networking/tun_device.c
+++ b/src/libstrongswan/networking/tun_device.c
@@ -27,6 +27,20 @@
#include <unistd.h>
#include <net/if.h>
+#include "tun_device.h"
+
+#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H)
+
+#warning TUN devices are not supported!
+
+tun_device_t *tun_device_create(const char *name_tmpl)
+{
+ DBG1(DBG_LIB, "TUN devices are not supported");
+ return NULL;
+}
+
+#else /* TUN devices supported */
+
#ifdef __APPLE__
#include <net/if_utun.h>
#include <netinet/in_var.h>
@@ -37,8 +51,6 @@
#include <net/if_tun.h>
#endif
-#include "tun_device.h"
-
#include <library.h>
#include <utils/debug.h>
#include <threading/thread.h>
@@ -468,3 +480,5 @@ tun_device_t *tun_device_create(const char *name_tmpl)
}
return &this->public;
}
+
+#endif /* TUN devices supported */