1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Mon, 18 Apr 2016 12:22:22 +0200
Subject: [PATCH] HACK: fix building without linux/sctp.h
linux/sctp.h exists since kernel 3.10.
Upstream requires kernel 3.11 but this is useful for host-systemd.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
configure.ac | 4 ++++
src/core/socket.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/configure.ac b/configure.ac
index 335a718ad2c1..b13ab6f0b67d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -318,6 +318,10 @@ AC_CHECK_HEADERS([linux/btrfs.h], [], [])
AC_CHECK_HEADERS([linux/memfd.h], [], [])
AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
AC_CHECK_HEADERS([uchar.h], [], [])
+AC_CHECK_HEADERS([linux/sctp.h], [], [], [
+#include <stdint.h>
+#include <sys/socket.h>
+])
# unconditionally pull-in librt with old glibc versions
AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
diff --git a/src/core/socket.c b/src/core/socket.c
index 8750643d926c..e9f0d0f7c17e 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -26,7 +26,11 @@
#include <sys/epoll.h>
#include <sys/stat.h>
#include <unistd.h>
+#ifdef HAVE_LINUX_SCTP_H
#include <linux/sctp.h>
+#else
+#define SCTP_NODELAY 3
+#endif
#include "alloc-util.h"
#include "bus-error.h"
|