From 9317d3b159125c47ce46020cdd1a29d7cea0966f Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sun, 26 Nov 2017 14:54:13 +0800 Subject: [PATCH] Fix the missing TFO flags on Android --- src/netutils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/netutils.h b/src/netutils.h index 3845d251..80dcb221 100644 --- a/src/netutils.h +++ b/src/netutils.h @@ -35,6 +35,16 @@ #include #endif +/* Hard coded defines for TCP fast open on Android */ +#ifdef __ANDROID__ +#ifndef TCP_FASTOPEN +#define TCP_FASTOPEN 23 +#endif +#ifndef MSG_FASTOPEN +#define MSG_FASTOPEN 0x20000000 +#endif +#endif + /* MPTCP_ENABLED setsockopt values for kernel 4 & 3, best behaviour to be independant of kernel version is to test from newest to the latest values */ #ifndef MPTCP_ENABLED static const char mptcp_enabled_values[] = { 42, 26, 0 };