Commit f1d3055d authored by Ondřej Surý's avatar Ondřej Surý

Replace platform ISC_PLATFORM_HAVETFO with config ENABLE_TCP_FASTOPEN

parent 092edb5b
......@@ -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
......
......@@ -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;
else
enable_tcp_fastopen="yes"
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. */
if test "$enable_tcp_fastopen" = "yes"; then :
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#ifdef TCP_FASTOPEN
int has_tfo() { return (0); }
#endif
$as_echo "#define ENABLE_TCP_FASTOPEN 1" >>confdefs.h
_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"
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
#
# Check for some other useful functions that are not ever-present.
......
......@@ -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_MSG_CHECKING(for TCP_FASTOPEN socket option)
case "$enable_tcp_fastopen" in
yes|''|autodetect)
AC_EGREP_CPP(has_tfo, [
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#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"])
AC_ARG_ENABLE([tcp_fastopen],
[AS_HELP_STRING([--disable-tcp-fastopen],
[disable TCP Fast Open support [default=yes]])],
[], [enable_tcp_fastopen="yes"])
;;
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.
......
......@@ -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.
***/
......
......@@ -85,7 +85,7 @@
#include <sys/utsname.h>
#endif
#ifdef ISC_PLATFORM_HAVETFO
#ifdef ENABLE_TCP_FASTOPEN
#include <netinet/tcp.h>
#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];
/*
......
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment