diff --git a/config.h.in b/config.h.in index 4cd770ac7a..0b97d4107f 100644 --- a/config.h.in +++ b/config.h.in @@ -110,6 +110,9 @@ /* Define to enable rpz nsip rules. */ #undef ENABLE_RPZ_NSIP +/* define if you want TCP_FASTOPEN enabled if available */ +#undef ENABLE_TCP_FASTOPEN + /* Solaris hack to get select_large_fdset. */ #undef FD_SETSIZE diff --git a/configure b/configure index 81c249eda5..5525ff2dd0 100755 --- a/configure +++ b/configure @@ -715,7 +715,6 @@ DST_EXTRA_SRCS DST_EXTRA_OBJS USE_ISC_SPNEGO READLINE_LIB -ISC_PLATFORM_HAVETFO BIND9_CO_RULE LIBTOOL_MODE_UNINSTALL LIBTOOL_MODE_LINK @@ -1606,7 +1605,7 @@ Optional Features: --enable-backtrace log stack backtrace on abort [default=yes] --enable-symtable use internal symbol table for backtrace [all|minimal(default)|none] - --disable-tcp-fastopen disable TCP Fast Open support [default=autodetect] + --disable-tcp-fastopen disable TCP Fast Open support [default=yes] --disable-isc-spnego use SPNEGO from GSSAPI library --disable-chroot disable chroot --disable-linux-caps disable Linux capabilities @@ -17512,45 +17511,16 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check whether --enable-tcp_fastopen was given. if test "${enable_tcp_fastopen+set}" = set; then : enableval=$enable_tcp_fastopen; -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCP_FASTOPEN socket option" >&5 -$as_echo_n "checking for TCP_FASTOPEN socket option... " >&6; } -case "$enable_tcp_fastopen" in -yes|''|autodetect) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -#ifdef TCP_FASTOPEN -int has_tfo() { return (0); } -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "has_tfo" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ISC_PLATFORM_HAVETFO="#define ISC_PLATFORM_HAVETFO 1" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO" + enable_tcp_fastopen="yes" fi -rm -f conftest* - ;; - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO" - ;; -esac +if test "$enable_tcp_fastopen" = "yes"; then : +$as_echo "#define ENABLE_TCP_FASTOPEN 1" >>confdefs.h + +fi # # Check for some other useful functions that are not ever-present. diff --git a/configure.in b/configure.in index 6b5825e78f..cc65682838 100644 --- a/configure.in +++ b/configure.in @@ -1816,33 +1816,13 @@ AC_COMPILE_IFELSE( # comment in lib/isc/unix/socket.c). # -AC_ARG_ENABLE(tcp_fastopen, - AS_HELP_STRING([--disable-tcp-fastopen], - [disable TCP Fast Open support [default=autodetect]])) +AC_ARG_ENABLE([tcp_fastopen], + [AS_HELP_STRING([--disable-tcp-fastopen], + [disable TCP Fast Open support [default=yes]])], + [], [enable_tcp_fastopen="yes"]) -AC_MSG_CHECKING(for TCP_FASTOPEN socket option) -case "$enable_tcp_fastopen" in -yes|''|autodetect) - AC_EGREP_CPP(has_tfo, [ -#include -#include -#include -#ifdef TCP_FASTOPEN -int has_tfo() { return (0); } -#endif -], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_HAVETFO="#define ISC_PLATFORM_HAVETFO 1"], - [AC_MSG_RESULT(no) - ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"]) - - ;; - no) - AC_MSG_RESULT(disabled) - ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO" - ;; -esac -AC_SUBST(ISC_PLATFORM_HAVETFO) +AS_IF([test "$enable_tcp_fastopen" = "yes"], + [AC_DEFINE([ENABLE_TCP_FASTOPEN], [1], [define if you want TCP_FASTOPEN enabled if available])]) # # Check for some other useful functions that are not ever-present. diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index 6552c01f80..689950146d 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -36,17 +36,6 @@ *** Network. ***/ -/*! \brief - * Define if the system has struct lifconf which is a extended struct ifconf - * for IPv6. - */ -@ISC_PLATFORM_HAVELIFCONF@ - -/*! \brief - * Define if the system has TCP_FASTOPEN socket option. - */ -@ISC_PLATFORM_HAVETFO@ - /*** *** Miscellaneous. ***/ diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index d61827b16a..d8ecdcb3cb 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -85,7 +85,7 @@ #include #endif -#ifdef ISC_PLATFORM_HAVETFO +#ifdef ENABLE_TCP_FASTOPEN #include #endif @@ -5464,7 +5464,7 @@ isc__socket_filter(isc_socket_t *sock0, const char *filter) { */ static void set_tcp_fastopen(isc__socket_t *sock, unsigned int backlog) { -#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN) +#if defined(ENABLE_TCP_FASTOPEN) && defined(TCP_FASTOPEN) char strbuf[ISC_STRERRORSIZE]; /* diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index 9add374881..b4b9e2d609 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -3318,7 +3318,7 @@ isc__socket_filter(isc_socket_t *sock, const char *filter) { isc_result_t isc__socket_listen(isc_socket_t *sock, unsigned int backlog) { char strbuf[ISC_STRERRORSIZE]; -#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN) +#if defined(ENABLE_TCP_FASTOPEN) && defined(TCP_FASTOPEN) char on = 1; #endif @@ -3351,7 +3351,7 @@ isc__socket_listen(isc_socket_t *sock, unsigned int backlog) { return (ISC_R_UNEXPECTED); } -#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN) +#if defined(ENABLE_TCP_FASTOPEN) && defined(TCP_FASTOPEN) if (setsockopt(sock->fd, IPPROTO_TCP, TCP_FASTOPEN, &on, sizeof(on)) < 0) { strerror_r(errno, strbuf, sizeof(strbuf));