From bfa2201537cb0a1c33ae38201accde8067902135 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 20 Dec 2013 11:24:02 +0100 Subject: [PATCH] tun-device: Include system headers before our own On CentOS 6.5 the sys/capability.h header file defines _LINUX_TYPES_H without actually including that header, preventing its later inclusion here. As library.h (via which the capabilities headers are included) is not actually required in tun_device.[ch], moving the inclusion of tun_device.h would not strictly be necessary. But it's probably a good idea to include our own headers after system headers anyway, for if one of the recursively included files at a later point includes library.h we'd have the same problem again. --- src/libstrongswan/networking/tun_device.c | 7 +++++-- src/libstrongswan/networking/tun_device.h | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libstrongswan/networking/tun_device.c b/src/libstrongswan/networking/tun_device.c index ef296357e..ecefdc233 100644 --- a/src/libstrongswan/networking/tun_device.c +++ b/src/libstrongswan/networking/tun_device.c @@ -27,9 +27,11 @@ #include #include +#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H) + #include "tun_device.h" -#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H) +#include #warning TUN devices are not supported! @@ -52,7 +54,8 @@ tun_device_t *tun_device_create(const char *name_tmpl) #include #endif -#include +#include "tun_device.h" + #include #include diff --git a/src/libstrongswan/networking/tun_device.h b/src/libstrongswan/networking/tun_device.h index 1d330f133..543125beb 100644 --- a/src/libstrongswan/networking/tun_device.h +++ b/src/libstrongswan/networking/tun_device.h @@ -23,7 +23,6 @@ #ifndef TUN_DEVICE_H_ #define TUN_DEVICE_H_ -#include #include typedef struct tun_device_t tun_device_t;