Merge branch '835-use-UV_UDP_LINUX_RECVERR-to-detect-destination-unreachable' into 'main'

Set IP(V6)_RECVERR on connect UDP sockets (via libuv)

Closes #835

See merge request isc-projects/bind9!6171
This commit is contained in:
Ondřej Surý
2022-04-26 10:41:08 +00:00
3 changed files with 12 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
5869. [func] Enable use of IP(V6)_RECVERR on Linux that allows
the kernel to report destination host/network
unreachable errors to the userspace application.
[GL #4251]
5868. [cleanup] Use Daniel Lemire's "nearly divisionless" algorithm
for unbiased bounded random numbers, and move
re-seeding out of the hot path. [GL !6161]

View File

@@ -562,6 +562,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>],
[AC_MSG_RESULT([no])
AC_CHECK_DECLS([UV_UDP_RECVMMSG], [], [], [[#include <uv.h>]])])
# libuv recverr support
AC_CHECK_DECLS([UV_UDP_LINUX_RECVERR], [], [], [[#include <uv.h>]])
# [pairwise: --enable-doh --with-libnghttp2=auto, --enable-doh --with-libnghttp2=yes, --disable-doh]
AC_ARG_ENABLE([doh],
[AS_HELP_STRING([--disable-doh], [enable DNS over HTTPS, requires libnghttp2 (default=yes)])],

View File

@@ -882,6 +882,10 @@ udp_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
uv_bind_flags |= UV_UDP_IPV6ONLY;
}
#if HAVE_DECL_UV_UDP_LINUX_RECVERR
uv_bind_flags |= UV_UDP_LINUX_RECVERR;
#endif
r = uv_udp_bind(&sock->uv_handle.udp, &sock->iface.type.sa,
uv_bind_flags);
if (r != 0) {