From: Tobias Brunner Date: Wed, 4 Sep 2013 11:40:35 +0000 (+0200) Subject: tun_device: Add warning if TUN devices are not supported by platform X-Git-Tag: 5.1.1dr4~38 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=bf32cdfbf66efb6efb2d41e0bb19207c3da8f643 tun_device: Add warning if TUN devices are not supported by platform --- diff --git a/configure.ac b/configure.ac index a07bfa8..cb97145 100644 --- a/configure.ac +++ b/configure.ac @@ -489,7 +489,7 @@ AC_CHECK_FUNC( AC_CHECK_FUNCS(prctl mallinfo getpass closefrom getpwnam_r getgrnam_r getpwuid_r) -AC_CHECK_HEADERS(sys/sockio.h glob.h) +AC_CHECK_HEADERS(sys/sockio.h glob.h net/if_tun.h) AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h) AC_CHECK_HEADERS(netinet/ip6.h, [], [], [ diff --git a/src/libstrongswan/networking/tun_device.c b/src/libstrongswan/networking/tun_device.c index af7e571..65268d2 100644 --- a/src/libstrongswan/networking/tun_device.c +++ b/src/libstrongswan/networking/tun_device.c @@ -27,6 +27,20 @@ #include #include +#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 #include @@ -37,8 +51,6 @@ #include #endif -#include "tun_device.h" - #include #include #include @@ -468,3 +480,5 @@ tun_device_t *tun_device_create(const char *name_tmpl) } return &this->public; } + +#endif /* TUN devices supported */