tun_device: Add warning if TUN devices are not supported by platform
This commit is contained in:
committed by
Andreas Steffen
parent
5ec08a6a05
commit
bf32cdfbf6
+1
-1
@@ -489,7 +489,7 @@ AC_CHECK_FUNC(
|
|||||||
|
|
||||||
AC_CHECK_FUNCS(prctl mallinfo getpass closefrom getpwnam_r getgrnam_r getpwuid_r)
|
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(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
|
||||||
AC_CHECK_HEADERS(netinet/ip6.h, [], [],
|
AC_CHECK_HEADERS(netinet/ip6.h, [], [],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -27,6 +27,20 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <net/if.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__
|
#ifdef __APPLE__
|
||||||
#include <net/if_utun.h>
|
#include <net/if_utun.h>
|
||||||
#include <netinet/in_var.h>
|
#include <netinet/in_var.h>
|
||||||
@@ -37,8 +51,6 @@
|
|||||||
#include <net/if_tun.h>
|
#include <net/if_tun.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "tun_device.h"
|
|
||||||
|
|
||||||
#include <library.h>
|
#include <library.h>
|
||||||
#include <utils/debug.h>
|
#include <utils/debug.h>
|
||||||
#include <threading/thread.h>
|
#include <threading/thread.h>
|
||||||
@@ -468,3 +480,5 @@ tun_device_t *tun_device_create(const char *name_tmpl)
|
|||||||
}
|
}
|
||||||
return &this->public;
|
return &this->public;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* TUN devices supported */
|
||||||
|
|||||||
Reference in New Issue
Block a user