@@ -212,6 +212,21 @@ AC_DEFUN([OVS_CHECK_LINUX_TC], [
[Define to 1 if TCA_SKBEDIT_FLAGS is available.])])
])
+dnl OVS_CHECK_LINUX_SCTP_CT
+dnl
+dnl Checks for kernels which need additional SCTP state
+AC_DEFUN([OVS_CHECK_LINUX_SCTP_CT], [
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include <linux/netfilter/nfnetlink.h>
+#include <linux/netfilter/nfnetlink_conntrack.h>
+#include <linux/netfilter/nf_conntrack_common.h>
+#include <linux/netfilter/nf_conntrack_sctp.h>], [
+ int x = SCTP_CONNTRACK_HEARTBEAT_SENT;
+ ])],
+ [AC_DEFINE([HAVE_SCTP_CONNTRACK_HEARTBEATS], [1],
+ [Define to 1 if SCTP_CONNTRACK_HEARTBEAT_SENT is available.])])
+])
+
dnl OVS_FIND_DEPENDENCY(FUNCTION, SEARCH_LIBS, NAME_TO_PRINT)
dnl
dnl Check for a function in a library list.
@@ -186,6 +186,7 @@ AC_ARG_VAR(KARCH, [Kernel Architecture String])
AC_SUBST(KARCH)
OVS_CHECK_LINUX
OVS_CHECK_LINUX_TC
+OVS_CHECK_LINUX_SCTP_CT
OVS_CHECK_DPDK
OVS_CHECK_PRAGMA_MESSAGE
AC_SUBST([OVS_CFLAGS])
@@ -1,4 +1,5 @@
noinst_HEADERS += \
+ include/linux/netfilter/nf_conntrack_sctp.h \
include/linux/pkt_cls.h \
include/linux/tc_act/tc_pedit.h \
include/linux/tc_act/tc_skbedit.h \
new file mode 100644
@@ -0,0 +1,26 @@
+#ifndef __LINUX_NETFILTER_CONNTRACK_SCTP_WRAPPER_H
+#define __LINUX_NETFILTER_CONNTRACK_SCTP_WRAPPER_H 1
+
+#if defined(__KERNEL__) || defined(HAVE_SCTP_CONNTRACK_HEARTBEATS)
+#include_next <linux/netfilter/nf_conntrack_sctp.h>
+#else
+
+/* These are the states defined in the kernel UAPI for connection
+ * tracking. */
+enum sctp_conntrack {
+ SCTP_CONNTRACK_NONE,
+ SCTP_CONNTRACK_CLOSED,
+ SCTP_CONNTRACK_COOKIE_WAIT,
+ SCTP_CONNTRACK_COOKIE_ECHOED,
+ SCTP_CONNTRACK_ESTABLISHED,
+ SCTP_CONNTRACK_SHUTDOWN_SENT,
+ SCTP_CONNTRACK_SHUTDOWN_RECD,
+ SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
+ SCTP_CONNTRACK_HEARTBEAT_SENT,
+ SCTP_CONNTRACK_HEARTBEAT_ACKED,
+ SCTP_CONNTRACK_MAX
+};
+
+#endif
+
+#endif
Bake in the SCTP states from the kernel UAPI. This means an older revision of the kernel headers won't interfere with the SCTP display enhancement. Additionally, if a newer version is available, or if x-compiling the datapath module we defer to that version (since this is just meant to provide the missing definitions). This will be used in a future commit. Signed-off-by: Aaron Conole <aconole@redhat.com> --- v3: introduced acinclude.m4 | 15 ++++++++++++ configure.ac | 1 + include/linux/automake.mk | 1 + include/linux/netfilter/nf_conntrack_sctp.h | 26 +++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 include/linux/netfilter/nf_conntrack_sctp.h