From: Charles-Henri Bruyand Date: Sun, 30 Jul 2023 15:00:10 +0000 (+0200) Subject: dnsdist: configurable DoQ and quiche checks X-Git-Tag: rec-5.0.0-alpha2~6^2~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=555b64d916d74ff0764318c20935853b75ec9960;p=thirdparty%2Fpdns.git dnsdist: configurable DoQ and quiche checks --- diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index e30075c25c..11495c3c79 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -20,6 +20,7 @@ CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -fvisibility=hidden CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls -fvisibility=hidden $CXXFLAGS" PDNS_WITH_LIBSODIUM +PDNS_WITH_QUICHE PDNS_CHECK_DNSTAP([auto]) PDNS_CHECK_RAGEL([dnslabeltext.cc], [www.dnsdist.org]) PDNS_WITH_LIBEDIT @@ -80,6 +81,7 @@ DNSDIST_ENABLE_TLS_PROVIDERS PDNS_ENABLE_DNS_OVER_TLS DNSDIST_ENABLE_DNS_OVER_HTTPS +DNSDIST_ENABLE_DNS_OVER_QUIC AS_IF([test "x$enable_dns_over_tls" != "xno" -o "x$enable_dns_over_https" != "xno"], [ PDNS_WITH_LIBSSL @@ -105,6 +107,13 @@ AS_IF([test "x$enable_dns_over_https" != "xno"], [ ]) ]) +AS_IF([test "x$enable_dns_over_quic" != "xno"], [ + AS_IF([test "x$HAVE_QUICHE" != "x1"], [ + AC_MSG_ERROR([DNS over QUIC support requested but quiche was not found]) + ]) +]) + +PDNS_WITH_NGHTTP2 DNSDIST_WITH_CDB PDNS_CHECK_LMDB PDNS_ENABLE_IPCIPHER @@ -218,6 +227,10 @@ AS_IF([test "x$FSTRM_LIBS" != "x"], [AC_MSG_NOTICE([dnstap: yes])], [AC_MSG_NOTICE([dnstap: no])] ) +AS_IF([test "x$QUICHE_LIBS" != "x"], + [AC_MSG_NOTICE([quiche: yes])], + [AC_MSG_NOTICE([quiche: no])] +) AS_IF([test "x$RE2_LIBS" != "x"], [AC_MSG_NOTICE([re2: yes])], [AC_MSG_NOTICE([re2: no])] @@ -234,6 +247,10 @@ AS_IF([test "x$enable_dns_over_https" != "xno"], [AC_MSG_NOTICE([DNS over HTTPS (DoH): yes])], [AC_MSG_NOTICE([DNS over HTTPS (DoH): no])] ) +AS_IF([test "x$enable_dns_over_quic" != "xno"], + [AC_MSG_NOTICE([DNS over QUIC (DoQ): yes])], + [AC_MSG_NOTICE([DNS over QUIC (DoQ): no])] +) AS_IF([test "x$enable_dns_over_tls" != "xno"], [ AS_IF([test "x$GNUTLS_LIBS" != "x"], [AC_MSG_NOTICE([GnuTLS: yes])], diff --git a/pdns/dnsdistdist/m4/dnsdist_enable_doq.m4 b/pdns/dnsdistdist/m4/dnsdist_enable_doq.m4 new file mode 100644 index 0000000000..e0ea5fc6a1 --- /dev/null +++ b/pdns/dnsdistdist/m4/dnsdist_enable_doq.m4 @@ -0,0 +1,14 @@ +AC_DEFUN([DNSDIST_ENABLE_DNS_OVER_QUIC], [ + AC_MSG_CHECKING([whether to enable incoming DNS over QUIC (DoH) support]) + AC_ARG_ENABLE([dns-over-quic], + AS_HELP_STRING([--enable-dns-over-quic], [enable incoming DNS over QUIC (DoQ) support (requires quiche) @<:@default=no@:>@]), + [enable_dns_over_quic=$enableval], + [enable_dns_over_quic=no] + ) + AC_MSG_RESULT([$enable_dns_over_quic]) + AM_CONDITIONAL([HAVE_DNS_OVER_QUIC], [test "x$enable_dns_over_quic" != "xno"]) + + AM_COND_IF([HAVE_DNS_OVER_QUIC], [ + AC_DEFINE([HAVE_DNS_OVER_QUIC], [1], [Define to 1 if you enable DNS over QUIC support]) + ]) +]) diff --git a/pdns/dnsdistdist/m4/pdns_with_quiche.m4 b/pdns/dnsdistdist/m4/pdns_with_quiche.m4 new file mode 100644 index 0000000000..40d94ddb56 --- /dev/null +++ b/pdns/dnsdistdist/m4/pdns_with_quiche.m4 @@ -0,0 +1,29 @@ +AC_DEFUN([PDNS_WITH_QUICHE], [ + AC_MSG_CHECKING([whether we will be linking in quiche]) + HAVE_QUICHE=0 + AC_ARG_WITH([quiche], + AS_HELP_STRING([--with-quiche],[use quiche @<:@default=auto@:>@]), + [with_quiche=$withval], + [with_quiche=auto], + ) + AC_MSG_RESULT([$with_quiche]) + + AS_IF([test "x$with_quiche" != "xno"], [ + AS_IF([test "x$with_quiche" = "xyes" -o "x$with_quiche" = "xauto"], [ + PKG_CHECK_MODULES([QUICHE], [quiche], [ + [HAVE_QUICHE=1] + AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche]) + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + CFLAGS="$QUICHE_CFLAGS $CFLAGS" + LIBS="$QUICHE_LIBS $LIBS" + ], [ : ]) + ]) + ]) + AM_CONDITIONAL([HAVE_QUICHE], [test "x$QUICHE_LIBS" != "x"]) + AS_IF([test "x$with_quiche" = "xyes"], [ + AS_IF([test x"$QUICHE_LIBS" = "x"], [ + AC_MSG_ERROR([quiche requested but libraries were not found]) + ]) + ]) +])