]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
optionally use libngtcp2 only in development builds
authorAydın Mercan <aydin@isc.org>
Tue, 17 Feb 2026 12:43:16 +0000 (15:43 +0300)
committerAydın Mercan <aydin@isc.org>
Wed, 25 Mar 2026 12:00:28 +0000 (15:00 +0300)
Unlike new transports with a new dependency DNS-over-QUIC support will
be added incrementally due to the non-trivial amound of plumbing
required by libngtcp2. This will require non-functional QUIC code in the
main branch that won't be exposed for non-development builds.

Therefore, libngtcp2 is linked as an optional dependency only on
explicitly enabled development builds and cannot be required. This will
be changed with a `doq` meson build option once the server-side
functionality is complete for consumption.

bin/named/main.c
meson.build

index 984c01c85aaf3a587d8cfda33e47de39fdf95a92..de12a973243ed42677ae19cb9a82cba2c928d077 100644 (file)
 #include <nghttp2/nghttp2.h>
 #endif
 
+#ifdef HAVE_LIBNGTCP2
+#include <ngtcp2/ngtcp2.h>
+#endif /* HAVE_LIBNGTCP2 */
+
 /* On DragonFly BSD the header does not provide jemalloc API */
 #if defined(HAVE_MALLOC_NP_H) && !defined(__DragonFly__)
 #include <malloc_np.h>
@@ -558,6 +562,11 @@ printversion(bool verbose) {
        nginfo = nghttp2_version(1);
        printf("linked to libnghttp2 version: %s\n", nginfo->version_str);
 #endif
+#ifdef HAVE_LIBNGTCP2
+       const ngtcp2_info *ngtcpinfo = ngtcp2_version(0);
+       printf("compiled with libngtcp2 version: %s\n", NGTCP2_VERSION);
+       printf("linked to libngtcp2 version: %s\n", ngtcpinfo->version_str);
+#endif /* HAVE_LIBNGTCP2 */
 #ifdef HAVE_LIBXML2
        printf("compiled with libxml2 version: %s\n", LIBXML_DOTTED_VERSION);
        printf("linked to libxml2 version: %s\n", xmlParserVersion);
index 60b4e4b99169caab3335b78fd86014e6940d12d7..269f24636bab2030357b484b1a065742def5672c 100644 (file)
@@ -798,6 +798,13 @@ if doh_opt.allowed()
     endif
 endif
 
+## DNS-over-QUIC (DoQ) [IN PROGRESS, DEVELOPER MODE ONLY]
+ngtcp2_dep = null_dep
+if developer_mode
+    ngtcp2_dep = dependency('libngtcp2', required: false)
+    config.set('HAVE_LIBNGTCP2', ngtcp2_dep.found())
+endif
+
 ## GeoIP
 maxminddb_dep = null_dep
 if geoip_opt.allowed()
@@ -1655,6 +1662,7 @@ executable(
         json_c_dep,
         lmdb_dep,
         nghttp2_dep,
+        ngtcp2_dep,
         xml2_dep,
         zlib_dep,