]> git.ipfire.org Git - thirdparty/bind9.git/commit
Handle the transient TCP connect() failures on FreeBSD
authorOndřej Surý <ondrej@isc.org>
Wed, 13 Jul 2022 07:34:47 +0000 (09:34 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 14 Jul 2022 12:20:10 +0000 (14:20 +0200)
commitb21f507c0ac5b5d2d2c27fd2d71e27e8605dd5fc
tree030fbaa333a783e475310ec450fdd2d9a0b6c621
parentb8f4e19366dcae07837c6c9bf11c78b15f220537
Handle the transient TCP connect() failures on FreeBSD

On FreeBSD (and perhaps other *BSD) systems, the TCP connect() call (via
uv_tcp_connect()) can fail with transient UV_EADDRINUSE error.  The UDP
code already handles this by trying three times (is a charm) before
giving up.  Add a code for the TCP, TCPDNS and TLSDNS layers to also try
three times before giving up by calling uv_tcp_connect() from the
callback two more time on UV_EADDRINUSE error.

Additionally, stop the timer only if we succeed or on hard error via
isc__nm_failed_connect_cb().
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tcp.c
lib/isc/netmgr/tcpdns.c
lib/isc/netmgr/tlsdns.c
lib/isc/netmgr/udp.c