From: Remi Gacogne Date: Mon, 2 Feb 2026 14:16:20 +0000 (+0100) Subject: dnsdist: Work around Quiche not dealing well with removed congestion algorithms X-Git-Tag: rec-5.5.0-alpha0~39^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d677611e5855b7db1d940c85df8259ce98e481a7;p=thirdparty%2Fpdns.git dnsdist: Work around Quiche not dealing well with removed congestion algorithms See https://github.com/cloudflare/quiche/issues/2342 Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc index a4b44e0d43..dbbc93e08e 100644 --- a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc +++ b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc @@ -338,9 +338,7 @@ static bool handleTLSConfiguration(const Context& context, const dnsdist::rust:: frontend->d_quicheParams.d_maxInFlight = bind.doq.max_concurrent_queries_per_connection; frontend->d_quicheParams.d_idleTimeout = bind.quic.idle_timeout; frontend->d_quicheParams.d_keyLogFile = std::string(bind.tls.key_log_file); - if (dnsdist::doq::s_available_cc_algorithms.count(std::string(bind.quic.congestion_control_algorithm)) > 0) { - frontend->d_quicheParams.d_ccAlgo = std::string(bind.quic.congestion_control_algorithm); - } + frontend->d_quicheParams.d_ccAlgo = std::string(bind.quic.congestion_control_algorithm); frontend->d_internalPipeBufferSize = bind.quic.internal_pipe_buffer_size; state.doqFrontend = std::move(frontend); } @@ -352,9 +350,7 @@ static bool handleTLSConfiguration(const Context& context, const dnsdist::rust:: frontend->d_quicheParams.d_tlsConfig = std::move(tlsConfig); frontend->d_quicheParams.d_idleTimeout = bind.quic.idle_timeout; frontend->d_quicheParams.d_keyLogFile = std::string(bind.tls.key_log_file); - if (dnsdist::doq::s_available_cc_algorithms.count(std::string(bind.quic.congestion_control_algorithm)) > 0) { - frontend->d_quicheParams.d_ccAlgo = std::string(bind.quic.congestion_control_algorithm); - } + frontend->d_quicheParams.d_ccAlgo = std::string(bind.quic.congestion_control_algorithm); frontend->d_internalPipeBufferSize = bind.quic.internal_pipe_buffer_size; state.doh3Frontend = std::move(frontend); } diff --git a/pdns/dnsdistdist/dnsdist-lua.cc b/pdns/dnsdistdist/dnsdist-lua.cc index 2903a95c65..f5a34c54b8 100644 --- a/pdns/dnsdistdist/dnsdist-lua.cc +++ b/pdns/dnsdistdist/dnsdist-lua.cc @@ -2432,13 +2432,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) { std::string valueStr; if (getOptionalValue(vars, "congestionControlAlgo", valueStr) > 0) { - if (dnsdist::doq::s_available_cc_algorithms.count(valueStr) > 0) { - frontend->d_quicheParams.d_ccAlgo = std::move(valueStr); - } - else { - SLOG(warnlog("Ignoring unknown value '%s' for 'congestionControlAlgo' on 'addDOH3Local'", valueStr), - getLogger("addDOH3Local")->info(Logr::Warning, "Ignoring unknown value for 'congestionControlAlgo'", "frontend.address", Logging::Loggable(addr), "value", Logging::Loggable(valueStr))); - } + frontend->d_quicheParams.d_ccAlgo = std::move(valueStr); } } parseTLSConfig(frontend->d_quicheParams.d_tlsConfig, "addDOH3Local", vars); @@ -2512,13 +2506,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) { std::string valueStr; if (getOptionalValue(vars, "congestionControlAlgo", valueStr) > 0) { - if (dnsdist::doq::s_available_cc_algorithms.count(valueStr) > 0) { - frontend->d_quicheParams.d_ccAlgo = std::move(valueStr); - } - else { - SLOG(warnlog("Ignoring unknown value '%s' for 'congestionControlAlgo' on 'addDOQLocal'", valueStr), - getLogger("addDOQLocal")->info(Logr::Warning, "Ignoring unknown value for 'congestionControlAlgo'", "frontend.address", Logging::Loggable(addr), "value", Logging::Loggable(valueStr))); - } + frontend->d_quicheParams.d_ccAlgo = std::move(valueStr); } } parseTLSConfig(frontend->d_quicheParams.d_tlsConfig, "addDOQLocal", vars); diff --git a/pdns/dnsdistdist/doq-common.cc b/pdns/dnsdistdist/doq-common.cc index 8236a14a0b..f3c58bc55d 100644 --- a/pdns/dnsdistdist/doq-common.cc +++ b/pdns/dnsdistdist/doq-common.cc @@ -284,10 +284,7 @@ void configureQuiche(QuicheConfig& config, const QuicheParams& params, bool isHT quiche_config_log_keys(config.get()); } - auto algo = dnsdist::doq::s_available_cc_algorithms.find(params.d_ccAlgo); - if (algo != dnsdist::doq::s_available_cc_algorithms.end()) { - quiche_config_set_cc_algorithm(config.get(), static_cast(algo->second)); - } + quiche_config_set_cc_algorithm_name(config.get(), params.d_ccAlgo.c_str()); { PacketBuffer resetToken; diff --git a/pdns/dnsdistdist/doq-common.hh b/pdns/dnsdistdist/doq-common.hh index 96f99dbfc9..0ba4c28e32 100644 --- a/pdns/dnsdistdist/doq-common.hh +++ b/pdns/dnsdistdist/doq-common.hh @@ -39,13 +39,6 @@ namespace dnsdist::doq { - -static const std::map s_available_cc_algorithms = { - {"reno", QUICHE_CC_RENO}, - {"cubic", QUICHE_CC_CUBIC}, - {"bbr", QUICHE_CC_BBR}, -}; - using QuicheConnection = std::unique_ptr; using QuicheHTTP3Connection = std::unique_ptr; using QuicheConfig = std::shared_ptr;