From 67c3309f918d09339289151441439d4fce641da1 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 4 Feb 2025 16:24:08 +0100 Subject: [PATCH] dnsdist: Handle Quiche >= 0.23.0 since the API changed Quiche 0.23.0 has renamed `quiche_h3_event_headers_has_body` to `quiche_h3_event_headers_has_more_frames`, so we need to handle that. (cherry picked from commit 35ab1dbe0ab9814445e8be8ba3ab7b719e1b5667) --- pdns/dnsdistdist/doh3.cc | 4 ++++ pdns/dnsdistdist/m4/pdns_with_quiche.m4 | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pdns/dnsdistdist/doh3.cc b/pdns/dnsdistdist/doh3.cc index 4f1a32e071..236c19369b 100644 --- a/pdns/dnsdistdist/doh3.cc +++ b/pdns/dnsdistdist/doh3.cc @@ -751,7 +751,11 @@ static void processH3HeaderEvent(ClientState& clientState, DOH3Frontend& fronten } if (headers.at(":method") == "POST") { +#if defined(HAVE_QUICHE_H3_EVENT_HEADERS_HAS_MORE_FRAMES) + if (!quiche_h3_event_headers_has_more_frames(event)) { +#else if (!quiche_h3_event_headers_has_body(event)) { +#endif handleImmediateError("Empty POST query"); } return; diff --git a/pdns/dnsdistdist/m4/pdns_with_quiche.m4 b/pdns/dnsdistdist/m4/pdns_with_quiche.m4 index 672fe0f79f..31f8682e5c 100644 --- a/pdns/dnsdistdist/m4/pdns_with_quiche.m4 +++ b/pdns/dnsdistdist/m4/pdns_with_quiche.m4 @@ -10,16 +10,23 @@ AC_DEFUN([PDNS_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 >= 0.22.0], [ + PKG_CHECK_MODULES([QUICHE], [quiche >= 0.23.0], [ [HAVE_QUICHE=1] AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche]) + AC_DEFINE([HAVE_QUICHE_H3_EVENT_HEADERS_HAS_MORE_FRAMES], [1], [Define to 1 if the Quiche API has quiche_h3_event_headers_has_more_frames instead of quiche_h3_event_headers_has_body]) AC_DEFINE([HAVE_QUICHE_STREAM_ERROR_CODES], [1], [Define to 1 if the Quiche API includes error code in quiche_conn_stream_recv and quiche_conn_stream_send]) ], [ - # Quiche is older than 0.22.0, or no Quiche at all - PKG_CHECK_MODULES([QUICHE], [quiche >= 0.15.0], [ + PKG_CHECK_MODULES([QUICHE], [quiche >= 0.22.0], [ [HAVE_QUICHE=1] AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche]) - ], [ : ]) + AC_DEFINE([HAVE_QUICHE_STREAM_ERROR_CODES], [1], [Define to 1 if the Quiche API includes error code in quiche_conn_stream_recv and quiche_conn_stream_send]) + ], [ + # Quiche is older than 0.22.0, or no Quiche at all + PKG_CHECK_MODULES([QUICHE], [quiche >= 0.15.0], [ + [HAVE_QUICHE=1] + AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche]) + ], [ : ]) + ]) ]) ]) ]) -- 2.47.2