]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
tun-device: Rearrange headers to build properly when tun devices not supported
authorMartin Willi <martin@revosec.ch>
Fri, 11 Oct 2013 13:43:30 +0000 (15:43 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 3 Jun 2014 10:24:34 +0000 (12:24 +0200)
src/libstrongswan/networking/tun_device.c

index f2c7b162f1c06eec75805d3284b6c4df24e2013b..ff2c4a337e11863c2cb41b8e5b7149a3e4379dfd 100644 (file)
  * for more details.
  */
 
-#include <errno.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <net/if.h>
-
-#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H)
-
 #include "tun_device.h"
 
 #include <utils/debug.h>
+#include <threading/thread.h>
 
-#warning TUN devices are not supported!
+#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H)
 
 tun_device_t *tun_device_create(const char *name_tmpl)
 {
@@ -43,6 +31,17 @@ tun_device_t *tun_device_create(const char *name_tmpl)
 
 #else /* TUN devices supported */
 
+#include <errno.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <net/if.h>
+
 #ifdef __APPLE__
 #include <net/if_utun.h>
 #include <netinet/in_var.h>
@@ -58,11 +57,6 @@ tun_device_t *tun_device_create(const char *name_tmpl)
 #include <net/if_tun.h>
 #endif
 
-#include "tun_device.h"
-
-#include <utils/debug.h>
-#include <threading/thread.h>
-
 #define TUN_DEFAULT_MTU 1500
 
 typedef struct private_tun_device_t private_tun_device_t;