From 7238c85c88d97458257795896ea9a17792b37669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 27 Sep 2022 13:56:55 +0200 Subject: [PATCH 1/4] Drop Debian buster from the CI The Debian buster is official EOL and in the LTS mode, so we can drop this for the next stable BIND 9 release. --- .gitlab-ci.yml | 31 ------------------------------- doc/arm/platforms.inc.rst | 4 ++-- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6aeef63e2..6b8a37390b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -122,10 +122,6 @@ stages: # Debian -.debian-buster-amd64: &debian_buster_amd64_image - image: "$CI_REGISTRY_IMAGE:debian-buster-amd64" - <<: *linux_amd64 - .debian-bullseye-amd64: &debian_bullseye_amd64_image image: "$CI_REGISTRY_IMAGE:debian-bullseye-amd64" <<: *linux_amd64 @@ -657,33 +653,6 @@ unit:gcc:oraclelinux9:amd64: - job: gcc:oraclelinux9:amd64 artifacts: true -# Jobs for regular GCC builds on Debian 10 "buster" (amd64) - -gcc:buster:amd64: - variables: - CC: gcc - CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2" - <<: *debian_buster_amd64_image - <<: *build_job - <<: *api_schedules_tags_triggers_web_triggering_rules - -system:gcc:buster:amd64: - <<: *debian_buster_amd64_image - <<: *system_test_job - <<: *api_schedules_tags_triggers_web_triggering_rules - needs: - - job: gcc:buster:amd64 - artifacts: true - -unit:gcc:buster:amd64: - <<: *debian_buster_amd64_image - <<: *unit_test_job - <<: *api_schedules_tags_triggers_web_triggering_rules - needs: - - job: gcc:buster:amd64 - artifacts: true - # Jobs for regular GCC builds on Debian 11 "bullseye" (amd64) # (The second unit test job also executes unstable unit tests.) diff --git a/doc/arm/platforms.inc.rst b/doc/arm/platforms.inc.rst index ef17d6c5f7..6351ad9286 100644 --- a/doc/arm/platforms.inc.rst +++ b/doc/arm/platforms.inc.rst @@ -45,7 +45,7 @@ Regularly Tested Platforms As of August 2022, current versions of BIND 9 are fully supported and regularly tested on the following systems: -- Debian 10, 11 +- Debian 11 - Ubuntu LTS 18.04, 20.04, 22.04 - Fedora 36 - Red Hat Enterprise Linux / CentOS / Oracle Linux 7, 8, 9 @@ -92,7 +92,7 @@ supported platforms. - Ubuntu 14.04, 16.04 (Ubuntu ESM releases are not supported) - CentOS 6 - - Debian 8 Jessie, 9 Stretch + - Debian 8 Jessie, 9 Stretch, 10 Buster - FreeBSD 10.x, 11.x Unsupported Platforms From d5bead54c0c1e9dedb5f8a05b9ce7b291b2bb738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 27 Sep 2022 13:59:30 +0200 Subject: [PATCH 2/4] Drop Ubuntu 18.04 bionic from the CI The Ubuntu 18.04 bionic will go EOL in April 2023 before the next stable BIND 9 release, so we can drop this for the next stable BIND 9 release. --- .gitlab-ci.yml | 35 ++--------------------------------- doc/arm/platforms.inc.rst | 4 ++-- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b8a37390b..c2b5986df2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -152,10 +152,6 @@ stages: # Ubuntu -.ubuntu-bionic-amd64: &ubuntu_bionic_amd64_image - image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-amd64" - <<: *linux_amd64 - .ubuntu-focal-amd64: &ubuntu_focal_amd64_image image: "$CI_REGISTRY_IMAGE:ubuntu-focal-amd64" <<: *linux_amd64 @@ -880,40 +876,13 @@ unit:gcc:tumbleweed:amd64: - job: gcc:tumbleweed:amd64 artifacts: true -# Jobs for regular GCC builds on Ubuntu 18.04 Bionic Beaver (amd64) - -gcc:bionic:amd64: - variables: - CC: gcc - CFLAGS: "${CFLAGS_COMMON} -O2" - EXTRA_CONFIGURE: "--disable-dnstap --without-cmocka --without-gssapi" - <<: *ubuntu_bionic_amd64_image - <<: *build_job - <<: *api_schedules_tags_triggers_web_triggering_rules - -system:gcc:bionic:amd64: - <<: *ubuntu_bionic_amd64_image - <<: *system_test_job - <<: *api_schedules_tags_triggers_web_triggering_rules - needs: - - job: gcc:bionic:amd64 - artifacts: true - -unit:gcc:bionic:amd64: - <<: *ubuntu_bionic_amd64_image - <<: *unit_test_job - <<: *api_schedules_tags_triggers_web_triggering_rules - needs: - - job: gcc:bionic:amd64 - artifacts: true - # Jobs for regular GCC builds on Ubuntu 20.04 Focal Fossa (amd64) gcc:focal:amd64: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON} -Og" - EXTRA_CONFIGURE: "--disable-geoip --with-libidn2" + EXTRA_CONFIGURE: "--disable-dnstap --without-cmocka --without-gssapi --with-libidn2" <<: *ubuntu_focal_amd64_image <<: *build_job @@ -937,7 +906,7 @@ gcc:jammy:amd64: variables: CC: gcc CFLAGS: "${CFLAGS_COMMON}" - EXTRA_CONFIGURE: "--with-libidn2 --disable-doh" + EXTRA_CONFIGURE: "--disable-geoip --with-libidn2 --disable-doh" <<: *ubuntu_jammy_amd64_image <<: *build_job diff --git a/doc/arm/platforms.inc.rst b/doc/arm/platforms.inc.rst index 6351ad9286..9b6b4cb5aa 100644 --- a/doc/arm/platforms.inc.rst +++ b/doc/arm/platforms.inc.rst @@ -46,7 +46,7 @@ As of August 2022, current versions of BIND 9 are fully supported and regularly following systems: - Debian 11 -- Ubuntu LTS 18.04, 20.04, 22.04 +- Ubuntu LTS 20.04, 22.04 - Fedora 36 - Red Hat Enterprise Linux / CentOS / Oracle Linux 7, 8, 9 - FreeBSD 12.3, 13.1 @@ -90,7 +90,7 @@ supported platforms. - Platforms past or close to their respective EOL dates, such as: - - Ubuntu 14.04, 16.04 (Ubuntu ESM releases are not supported) + - Ubuntu 14.04, 16.04, 18.04 (Ubuntu ESM releases are not supported) - CentOS 6 - Debian 8 Jessie, 9 Stretch, 10 Buster - FreeBSD 10.x, 11.x From 0086ebf3fc837caf11c3d3afb6520cc9cd43d8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 27 Sep 2022 14:10:40 +0200 Subject: [PATCH 3/4] Bump the libuv requirement to libuv >= 1.34.0 By bumping the minimum libuv version to 1.34.0, it allows us to remove all libuv shims we ever had and makes the code much cleaner. The up-to-date libuv is available in all distributions supported by BIND 9.19+ either natively or as a backport. --- configure.ac | 4 +-- doc/arm/build.inc.rst | 2 +- doc/arm/platforms.inc.rst | 2 +- lib/isc/include/isc/uv.h | 57 -------------------------------- lib/isc/netmgr/udp.c | 8 ++--- lib/isc/uv.c | 69 --------------------------------------- tests/isc/udp_test.c | 5 --- tests/isc/uv_wrap.h | 12 ++----- 8 files changed, 8 insertions(+), 151 deletions(-) diff --git a/configure.ac b/configure.ac index 174f892f2e..609f138efe 100644 --- a/configure.ac +++ b/configure.ac @@ -552,8 +552,8 @@ AC_CHECK_HEADERS([pthread_np.h], [], [], [#include ]) # libuv AC_MSG_CHECKING([for libuv]) -PKG_CHECK_MODULES([LIBUV], [libuv >= 1.0.0], [], - [AC_MSG_ERROR([libuv not found])]) +PKG_CHECK_MODULES([LIBUV], [libuv >= 1.34.0], [], + [AC_MSG_ERROR([libuv >= 1.34.0 not found])]) AX_SAVE_FLAGS([libuv]) CFLAGS="$CFLAGS $LIBUV_CFLAGS" diff --git a/doc/arm/build.inc.rst b/doc/arm/build.inc.rst index 29486cb48c..8971bc4c20 100644 --- a/doc/arm/build.inc.rst +++ b/doc/arm/build.inc.rst @@ -60,7 +60,7 @@ To build BIND 9, the following packages must be installed: - ``perl`` - ``pkg-config`` / ``pkgconfig`` / ``pkgconf`` -BIND 9.19 requires ``libuv`` 1.x or higher. On older systems, an updated +BIND 9.19 requires ``libuv`` 1.34.0 or higher. On older systems, an updated ``libuv`` package needs to be installed from sources such as EPEL, PPA, or other native sources. The other option is to build and install ``libuv`` from source. diff --git a/doc/arm/platforms.inc.rst b/doc/arm/platforms.inc.rst index 9b6b4cb5aa..4fa089d0d8 100644 --- a/doc/arm/platforms.inc.rst +++ b/doc/arm/platforms.inc.rst @@ -107,7 +107,7 @@ These are platforms on which current versions of BIND 9 are known *not* to build - Platforms that do not support atomic operations (via compiler or library) - Linux without NPTL (Native POSIX Thread Library) -- Platforms on which **libuv** cannot be compiled +- Platforms on which **libuv >= 1.34** cannot be compiled or is not available Installing BIND 9 ----------------- diff --git a/lib/isc/include/isc/uv.h b/lib/isc/include/isc/uv.h index 25602d5717..476d8010c7 100644 --- a/lib/isc/include/isc/uv.h +++ b/lib/isc/include/isc/uv.h @@ -19,11 +19,6 @@ #include #include -/* - * These functions were introduced in newer libuv, but we still - * want BIND9 compile on older ones so we emulate them. - */ - #define UV_VERSION(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) /* @@ -47,58 +42,6 @@ #define UV__ERR(x) (-(x)) #endif -#if UV_VERSION_HEX < UV_VERSION(1, 12, 0) -int -uv_os_getenv(const char *name, char *buffer, size_t *size); - -#define uv_os_setenv(name, value) setenv(name, value, 0) -#endif /* UV_VERSION_HEX < UV_VERSION(1, 12, 0) */ - -#if UV_VERSION_HEX < UV_VERSION(1, 19, 0) -static inline void * -uv_handle_get_data(const uv_handle_t *handle) { - return (handle->data); -} - -static inline void -uv_handle_set_data(uv_handle_t *handle, void *data) { - handle->data = data; -} - -static inline void * -uv_req_get_data(const uv_req_t *req) { - return (req->data); -} - -static inline void -uv_req_set_data(uv_req_t *req, void *data) { - req->data = data; -} -#endif /* UV_VERSION_HEX < UV_VERSION(1, 19, 0) */ - -#if UV_VERSION_HEX < UV_VERSION(1, 32, 0) -int -uv_tcp_close_reset(uv_tcp_t *handle, uv_close_cb close_cb); -#endif - -#if UV_VERSION_HEX < UV_VERSION(1, 34, 0) -#define uv_sleep(msec) usleep(msec * 1000) -#endif /* UV_VERSION_HEX < UV_VERSION(1, 34, 0) */ - -#if UV_VERSION_HEX < UV_VERSION(1, 27, 0) -int -isc_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr); -/*%< - * Associate the UDP handle to a remote address and port, so every message sent - * by this handle is automatically sent to that destination. - * - * NOTE: This is just a limited shim for uv_udp_connect() as it requires the - * handle to be bound. - */ -#else /* UV_VERSION_HEX < UV_VERSION(1, 27, 0) */ -#define isc_uv_udp_connect uv_udp_connect -#endif /* UV_VERSION_HEX < UV_VERSION(1, 27, 0) */ - /* * These are used with all versions of libuv: */ diff --git a/lib/isc/netmgr/udp.c b/lib/isc/netmgr/udp.c index 4706c74a38..9b715d9b6c 100644 --- a/lib/isc/netmgr/udp.c +++ b/lib/isc/netmgr/udp.c @@ -725,17 +725,14 @@ isc__nm_udp_send(isc_nmhandle_t *handle, const isc_region_t *region, uvreq->cb.send = cb; uvreq->cbarg = cbarg; -#if UV_VERSION_HEX >= UV_VERSION(1, 27, 0) /* - * If we used uv_udp_connect() (and not the shim version for - * older versions of libuv), then the peer address has to be + * We used uv_udp_connect(), so the peer address has to be * set to NULL or else uv_udp_send() could fail or assert, * depending on the libuv version. */ if (atomic_load(&sock->connected)) { sa = NULL; } -#endif r = uv_udp_send(&uvreq->uv_req.udp_send, &sock->uv_handle.udp, &uvreq->uvbuf, 1, sa, udp_send_cb); @@ -790,8 +787,7 @@ udp_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) { * giving up. */ do { - r = isc_uv_udp_connect(&sock->uv_handle.udp, - &req->peer.type.sa); + r = uv_udp_connect(&sock->uv_handle.udp, &req->peer.type.sa); } while (r == UV_EADDRINUSE && --req->connect_tries > 0); if (r != 0) { isc__nm_incstats(sock, STATID_CONNECTFAIL); diff --git a/lib/isc/uv.c b/lib/isc/uv.c index 5f4b12dde6..62c34415a5 100644 --- a/lib/isc/uv.c +++ b/lib/isc/uv.c @@ -16,75 +16,6 @@ #include #include -#if UV_VERSION_HEX < UV_VERSION(1, 12, 0) -#include -#include - -int -uv_os_getenv(const char *name, char *buffer, size_t *size) { - size_t len; - char *buf = getenv(name); - if (buf == NULL) { - return (UV_ENOENT); - } - len = strlen(buf) + 1; - if (len > *size) { - *size = len; - return (UV_ENOBUFS); - } - *size = len; - memmove(buffer, buf, len); - return (0); -} - -#endif - -#if UV_VERSION_HEX < UV_VERSION(1, 27, 0) -int -isc_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr) { - int err = 0; - - do { - int addrlen = (addr->sa_family == AF_INET) - ? sizeof(struct sockaddr_in) - : sizeof(struct sockaddr_in6); - err = connect(handle->io_watcher.fd, addr, addrlen); - } while (err == -1 && errno == EINTR); - - if (err) { -#if UV_VERSION_HEX >= UV_VERSION(1, 10, 0) - return (uv_translate_sys_error(errno)); -#else - return (-errno); -#endif /* UV_VERSION_HEX >= UV_VERSION(1, 10, 0) */ - } - - return (0); -} -#endif /* UV_VERSION_HEX < UV_VERSION(1, 27, 0) */ - -#if UV_VERSION_HEX < UV_VERSION(1, 32, 0) -int -uv_tcp_close_reset(uv_tcp_t *handle, uv_close_cb close_cb) { - if (setsockopt(handle->io_watcher.fd, SOL_SOCKET, SO_LINGER, - &(struct linger){ 1, 0 }, sizeof(struct linger)) == -1) - { -#if UV_VERSION_HEX >= UV_VERSION(1, 10, 0) - return (uv_translate_sys_error(errno)); -#else - return (-errno); -#endif /* UV_VERSION_HEX >= UV_VERSION(1, 10, 0) */ - } - - INSIST(!uv_is_closing((uv_handle_t *)handle)); - uv_close((uv_handle_t *)handle, close_cb); - return (0); -} -#endif /* UV_VERSION_HEX < UV_VERSION(1, 32, 0) */ - -#define setsockopt_on(socket, level, name) \ - setsockopt(socket, level, name, &(int){ 1 }, sizeof(int)) - /*% * Convert a libuv error value into an isc_result_t. The * list of supported error values is not complete; new users diff --git a/tests/isc/udp_test.c b/tests/isc/udp_test.c index 0cfd4e62a9..9644f7c0fa 100644 --- a/tests/isc/udp_test.c +++ b/tests/isc/udp_test.c @@ -228,7 +228,6 @@ ISC_LOOP_TEST_IMPL(mock_udpconnect_uv_udp_bind) { RESET_RETURN; } -#if UV_VERSION_HEX >= UV_VERSION(1, 27, 0) ISC_LOOP_TEST_IMPL(mock_udpconnect_uv_udp_connect) { WILL_RETURN(uv_udp_connect, UV_ENOMEM); @@ -240,8 +239,6 @@ ISC_LOOP_TEST_IMPL(mock_udpconnect_uv_udp_connect) { RESET_RETURN; } -#endif - ISC_LOOP_TEST_IMPL(mock_udpconnect_uv_recv_buffer_size) { WILL_RETURN(uv_recv_buffer_size, UV_ENOMEM); @@ -1133,9 +1130,7 @@ ISC_TEST_ENTRY_CUSTOM(mock_listenudp_uv_udp_recv_start, setup_test, teardown_test) ISC_TEST_ENTRY_CUSTOM(mock_udpconnect_uv_udp_open, setup_test, teardown_test) ISC_TEST_ENTRY_CUSTOM(mock_udpconnect_uv_udp_bind, setup_test, teardown_test) -#if UV_VERSION_HEX >= UV_VERSION(1, 27, 0) ISC_TEST_ENTRY_CUSTOM(mock_udpconnect_uv_udp_connect, setup_test, teardown_test) -#endif ISC_TEST_ENTRY_CUSTOM(mock_udpconnect_uv_recv_buffer_size, setup_test, teardown_test) ISC_TEST_ENTRY_CUSTOM(mock_udpconnect_uv_send_buffer_size, setup_test, diff --git a/tests/isc/uv_wrap.h b/tests/isc/uv_wrap.h index f81c0c01b5..8a6f7598ff 100644 --- a/tests/isc/uv_wrap.h +++ b/tests/isc/uv_wrap.h @@ -38,13 +38,11 @@ __wrap_uv_udp_open(uv_udp_t *handle, uv_os_sock_t sock); int __wrap_uv_udp_bind(uv_udp_t *handle, const struct sockaddr *addr, unsigned int flags); -#if UV_VERSION_HEX >= UV_VERSION(1, 27, 0) int __wrap_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr); int __wrap_uv_udp_getpeername(const uv_udp_t *handle, struct sockaddr *name, int *namelen); -#endif /* UV_VERSION_HEX >= UV_VERSION(1, 27, 0) */ int __wrap_uv_udp_getsockname(const uv_udp_t *handle, struct sockaddr *name, int *namelen); @@ -118,7 +116,6 @@ __wrap_uv_udp_bind(uv_udp_t *handle, const struct sockaddr *addr, static atomic_int __state_uv_udp_connect __attribute__((unused)) = 0; -#if UV_VERSION_HEX >= UV_VERSION(1, 27, 0) int __wrap_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr) { if (atomic_load(&__state_uv_udp_connect) == 0) { @@ -126,11 +123,9 @@ __wrap_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr) { } return (atomic_load(&__state_uv_udp_connect)); } -#endif /* UV_VERSION_HEX >= UV_VERSION(1, 27, 0) */ static atomic_int __state_uv_udp_getpeername __attribute__((unused)) = 0; -#if UV_VERSION_HEX >= UV_VERSION(1, 27, 0) int __wrap_uv_udp_getpeername(const uv_udp_t *handle, struct sockaddr *name, int *namelen) { @@ -139,7 +134,6 @@ __wrap_uv_udp_getpeername(const uv_udp_t *handle, struct sockaddr *name, } return (atomic_load(&__state_uv_udp_getpeername)); } -#endif /* UV_VERSION_HEX >= UV_VERSION(1, 27, 0) */ static atomic_int __state_uv_udp_getsockname = 0; int @@ -275,12 +269,10 @@ __wrap_uv_fileno(const uv_handle_t *handle, uv_os_fd_t *fd) { return (atomic_load(&__state_uv_fileno)); } -#define uv_udp_open(...) __wrap_uv_udp_open(__VA_ARGS__) -#define uv_udp_bind(...) __wrap_uv_udp_bind(__VA_ARGS__) -#if UV_VERSION_HEX >= UV_VERSION(1, 27, 0) +#define uv_udp_open(...) __wrap_uv_udp_open(__VA_ARGS__) +#define uv_udp_bind(...) __wrap_uv_udp_bind(__VA_ARGS__) #define uv_udp_connect(...) __wrap_uv_udp_connect(__VA_ARGS__) #define uv_udp_getpeername(...) __wrap_uv_udp_getpeername(__VA_ARGS__) -#endif /* UV_VERSION_HEX >= UV_VERSION(1, 27, 0) */ #define uv_udp_getsockname(...) __wrap_uv_udp_getsockname(__VA_ARGS__) #define uv_udp_send(...) __wrap_uv_udp_send(__VA_ARGS__) #define uv_udp_recv_start(...) __wrap_uv_udp_recv_start(__VA_ARGS__) From 178e0317a61224c0d0b0d8ab1da2f2330d3cc16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 27 Sep 2022 14:16:17 +0200 Subject: [PATCH 4/4] Add CHANGES and release note for [GL #3567] --- CHANGES | 2 ++ doc/notes/notes-current.rst | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 10fbe1e068..b6d9b2c5e3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +5985. [func] Bump the minimal libuv version to 1.34.0. [GL #3567] + 5984. [func] 'named -V' now reports the list of supported DNSSEC/DS/HMAC algorithms and the supported TKEY modes. [GL #3541] diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index babef0ad71..5849fd13e8 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -67,6 +67,10 @@ Feature Changes with '-DOPENSSL_API_COMPAT=10100' specified in the CFLAGS at compile time. :gl:`!6711` +- Compiling BIND 9 now requires at least libuv version 1.34.0 or higher. The + libuv should be available on all supported platforms either as a native + package or as a backport. :gl:`#3567` + Bug Fixes ~~~~~~~~~