From 17d5627529c5cc20a2e8a7a03d2d18e4dacc53f0 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 13 Dec 2019 16:18:53 +0100 Subject: [PATCH] Make TCP_FASTOPEN work again for linux and FreeBSD --- CMakeLists.txt | 3 ++- cmake/include/cmakeconfig.h.in | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4fcce8b..f9977c76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -484,10 +484,11 @@ else () message(WARNING "TCP Fast Open not available, continuing without.") endif () else () + check_include_file(netinet/tcp.h HAVE_NETINET_TCP_H) check_symbol_exists(TCP_FASTOPEN "sys/socket.h;netinet/tcp.h" HAVE_DECL_TCP_FASTOPEN) check_symbol_exists(TCP_FASTOPEN_CONNECT "sys/socket.h;netinet/tcp.h" HAVE_DECL_TCP_FASTOPEN_CONNECT) check_symbol_exists(MSG_FASTOPEN "sys/socket.h;netinet/tcp.h" HAVE_DECL_MSG_FASTOPEN) - if (NOT TCP_FASTOPEN) + if (NOT HAVE_DECL_TCP_FASTOPEN) message(WARNING "TCP Fast Open not available, continuing without.") endif () endif () diff --git a/cmake/include/cmakeconfig.h.in b/cmake/include/cmakeconfig.h.in index 052a8a91..0a3ee804 100644 --- a/cmake/include/cmakeconfig.h.in +++ b/cmake/include/cmakeconfig.h.in @@ -35,6 +35,7 @@ #cmakedefine HAVE_NETDB_H 1 #cmakedefine HAVE_ARPA_INET_H 1 #cmakedefine HAVE_NETINET_IN_H 1 +#cmakedefine HAVE_NETINET_TCP_H 1 #cmakedefine HAVE_SYS_SELECT_H 1 #cmakedefine HAVE_SYS_SOCKET_H 1 #cmakedefine HAVE_SYS_SYSCTL_H 1 @@ -127,9 +128,9 @@ #cmakedefine HAVE_DECL_SIGADDSET 1 #cmakedefine HAVE_DECL_STRPTIME 1 -#cmakedefine USE_DECL_TCP_FASTOPEN 1 -#cmakedefine USE_DECL_TCP_FASTOPEN_CONNECT 1 -#cmakedefine USE_DECL_MSG_FASTOPEN 1 +#cmakedefine HAVE_DECL_TCP_FASTOPEN 1 +#cmakedefine HAVE_DECL_TCP_FASTOPEN_CONNECT 1 +#cmakedefine HAVE_DECL_MSG_FASTOPEN 1 #if defined(HAVE_DECL_INET_PTON) || defined(HAVE_WIN_DECL_INET_PTON) #undef HAVE_DECL_INET_PTON @@ -392,6 +393,10 @@ static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *fo #include #endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif + #ifdef HAVE_ARPA_INET_H #include #endif