BUILD: add explicit support for TFO with USE_TFO
TCP Fast Open is supported in server mode since Linux 3.7, but current
libc's don't define TCP_FASTOPEN=23. Introduce the new USE flag USE_TFO
to define it manually in compat.h. Also note this in the TFO related
documentation.
diff --git a/Makefile b/Makefile
index b66a07f..dd11aa0 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,7 @@
# USE_MY_ACCEPT4 : use own implemention of accept4() if glibc < 2.10.
# USE_ZLIB : enable zlib library support.
# USE_CPU_AFFINITY : enable pinning processes to CPU on Linux. Automatic.
+# USE_TFO : enable TCP fast open. Supported on Linux >= 3.7.
#
# Options can be forced by specifying "USE_xxx=1" or can be disabled by using
# "USE_xxx=" (empty string).
@@ -564,6 +565,12 @@
endif
endif
+# TCP Fast Open
+ifneq ($(USE_TFO),)
+OPTIONS_CFLAGS += -DUSE_TFO
+BUILD_OPTIONS += $(call ignore_implicit,USE_TFO)
+endif
+
# This one can be changed to look for ebtree files in an external directory
EBTREE_DIR := ebtree