aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-10-12 18:40:15 +0200
committerTobias Brunner <tobias@strongswan.org>2017-10-13 10:17:37 +0200
commit23e76d250f1fbc16537f039b00853aa71e8aa529 (patch)
tree0f55c94e30a7e89265015e9561a7b586ca9bcfe2
parenta97de61e78df611207a2700dad7057d9b74fb5bc (diff)
downloadstrongswan-23e76d250f1fbc16537f039b00853aa71e8aa529.tar.bz2
strongswan-23e76d250f1fbc16537f039b00853aa71e8aa529.tar.xz
streams: Named systemd sockets are only supported since systemd v227
-rw-r--r--configure.ac4
-rw-r--r--src/libstrongswan/networking/streams/stream_service_systemd.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a3d349db7..2d9ab05c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1002,6 +1002,10 @@ if test x$systemd = xtrue; then
AC_SUBST(systemd_journal_CFLAGS)
AC_SUBST(systemd_journal_LIBS)]
)
+ saved_LIBS=$LIBS
+ LIBS="$systemd_LIBS $systemd_daemon_LIBS"
+ AC_CHECK_FUNCS(sd_listen_fds_with_names)
+ LIBS=$saved_LIBS
fi
if test x$tss_trousers = xtrue; then
diff --git a/src/libstrongswan/networking/streams/stream_service_systemd.c b/src/libstrongswan/networking/streams/stream_service_systemd.c
index 64b92836a..5c6b3f690 100644
--- a/src/libstrongswan/networking/streams/stream_service_systemd.c
+++ b/src/libstrongswan/networking/streams/stream_service_systemd.c
@@ -29,6 +29,11 @@
*/
stream_service_t *stream_service_create_systemd(char *uri, int backlog)
{
+#ifndef HAVE_SD_LISTEN_FDS_WITH_NAMES
+ DBG1(DBG_NET, "unable to open stream URI '%s': named systemd sockets not "
+ "supported", uri);
+ return NULL;
+#else
int i, num_fds, fd;
char **fdmap;
@@ -62,4 +67,5 @@ stream_service_t *stream_service_create_systemd(char *uri, int backlog)
return NULL;
}
return stream_service_create_from_fd(fd);
+#endif
}