]> 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>
Wed, 9 Dec 2020 09:46:16 +0000 (10:46 +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 8721623f20d3d118aca73d32da7d43a0fe235a3e..03928224f8fdf6d17f67bec2125158091bf4b743 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 d1bbf7421ff264033f6eb15bff9c64d237460235..4943ffef7c84fceed6a509240157fbb176daa15c 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 3c58609a53854257a3307434d3fc8e2fb5935713..11ce8a10802e6a3292a0b4776ac7338a97db8cf5 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 03c11da74f10902dcbe189cb184bc87fb589722a..6393860df2fde84566db7bfc411cc28fe0c9eda1 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 a6cc32fd1cb0a9056cb4de84ccde9673e19f076e..15a3042e692ea556b45572d4b276e0a4de4083ea 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>