]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add FreeBSD connection timeout socket option
authorOndřej Surý <ondrej@sury.org>
Wed, 2 Dec 2020 20:54:25 +0000 (21:54 +0100)
committerOndřej Surý <ondrej@sury.org>
Thu, 3 Dec 2020 08:23:24 +0000 (09:23 +0100)
On FreeBSD, the option to configure connection timeout is called
TCP_KEEPINIT, use it to configure the connection timeout there.

This also fixes the dangling socket problems in the unit test, so
re-enable them.

lib/isc/netmgr/netmgr.c
lib/isc/tests/tcp_quota_test.c
lib/isc/tests/tcp_test.c
lib/isc/tests/tcpdns_test.c
lib/isc/tests/udp_test.c

index 9ed966a6edc9e8f60891beeb9aeb2aa251b69ea9..4e654e11d83df7722d3fc60806d03df51295cca3 100644 (file)
@@ -2283,6 +2283,10 @@ isc__nm_socket_dontfrag(uv_os_sock_t fd, sa_family_t sa_family) {
 #define TIMEOUT_TYPE   unsigned int
 #define TIMEOUT_DIV    1
 #define TIMEOUT_OPTNAME TCP_USER_TIMEOUT
+#elif defined(TCP_KEEPINIT)
+#define TIMEOUT_TYPE   int
+#define TIMEOUT_DIV    1000
+#define TIMEOUT_OPTNAME TCP_KEEPINIT
 #endif
 
 isc_result_t
index 0602dea28a903f934d4d462c2a802ad0969a3e59..849213b67722066ac967046c531ea24ef9204763 100644 (file)
@@ -9,7 +9,7 @@
  * information regarding copyright ownership.
  */
 
-#if HAVE_CMOCKA && defined(__linux__)
+#if HAVE_CMOCKA
 #include <sched.h> /* IWYU pragma: keep */
 #include <setjmp.h>
 #include <stdarg.h>
index 4c4fea0532dfeb07c649c2837a8a4c6252eca51b..a27ab80ebbf7067e87d4ac09d5b3d638b5eb5144 100644 (file)
@@ -9,7 +9,7 @@
  * information regarding copyright ownership.
  */
 
-#if HAVE_CMOCKA && defined(__linux__)
+#if HAVE_CMOCKA
 #include <sched.h> /* IWYU pragma: keep */
 #include <setjmp.h>
 #include <stdarg.h>
index c21a7cb73cbe2aad4173c647086ad993f1069dff..21459645921c2080db9a9eb4da1e2c99f31897e9 100644 (file)
@@ -9,7 +9,7 @@
  * information regarding copyright ownership.
  */
 
-#if HAVE_CMOCKA && defined(__linux__)
+#if HAVE_CMOCKA
 #include <sched.h> /* IWYU pragma: keep */
 #include <setjmp.h>
 #include <stdarg.h>
index b3062cc4655b19b31b80cb77eb2ff48638c4d84d..a1a99314e26a5f187191f36120b433b5d267f58b 100644 (file)
@@ -9,7 +9,7 @@
  * information regarding copyright ownership.
  */
 
-#if HAVE_CMOCKA && defined(__linux__)
+#if HAVE_CMOCKA
 #include <sched.h> /* IWYU pragma: keep */
 #include <setjmp.h>
 #include <stdarg.h>