summaryrefslogtreecommitdiff
path: root/src/libstrongswan/networking
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/networking')
-rw-r--r--src/libstrongswan/networking/streams/stream_service.c2
-rw-r--r--src/libstrongswan/networking/tun_device.c18
2 files changed, 17 insertions, 3 deletions
diff --git a/src/libstrongswan/networking/streams/stream_service.c b/src/libstrongswan/networking/streams/stream_service.c
index ece17b41f..4e0eebddb 100644
--- a/src/libstrongswan/networking/streams/stream_service.c
+++ b/src/libstrongswan/networking/streams/stream_service.c
@@ -264,7 +264,7 @@ stream_service_t *stream_service_create_unix(char *uri, int backlog)
}
unlink(addr.sun_path);
- old = umask(~(S_IRWXU | S_IRWXG));
+ old = umask(S_IRWXO);
if (bind(fd, (struct sockaddr*)&addr, len) < 0)
{
DBG1(DBG_NET, "binding socket '%s' failed: %s", uri, strerror(errno));
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 */