mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2026-05-06 07:27:03 -04:00
net-dns/dnsdist: add fix for removed BBR CC in >=quiche-0.24.7
Closes: https://bugs.gentoo.org/971393 Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com> Part-of: https://codeberg.org/gentoo/gentoo/pulls/383 Merges: https://codeberg.org/gentoo/gentoo/pulls/383 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
committed by
Sam James
parent
bf9f271102
commit
90fc3ead58
@@ -0,0 +1,185 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
LUA_COMPAT=( lua5-{1..4} luajit )
|
||||
PYTHON_COMPAT=( python3_{11..14} )
|
||||
RUST_MIN_VER="1.85.1"
|
||||
RUST_OPTIONAL=1
|
||||
|
||||
inherit cargo flag-o-matic lua-single meson python-any-r1 toolchain-funcs
|
||||
|
||||
DESCRIPTION="A highly DNS-, DoS- and abuse-aware loadbalancer"
|
||||
HOMEPAGE="https://www.dnsdist.org/index.html"
|
||||
|
||||
if [[ ${PV} == *9999* ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/PowerDNS/pdns"
|
||||
EGIT_BRANCH="master"
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://downloads.powerdns.com/releases/${P}.tar.xz"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
fi
|
||||
|
||||
SRC_URI+="
|
||||
doc? ( https://www.applied-asynchrony.com/distfiles/${PN}-docs-${PV}.tar.xz )
|
||||
yaml? ( https://www.applied-asynchrony.com/distfiles/${PN}-rust-${PV}-crates.tar.xz )
|
||||
"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
IUSE="bpf cdb dnscrypt dnstap doc doh doh3 ipcipher lmdb quic regex snmp +ssl systemd test web xdp yaml"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
REQUIRED_USE="${LUA_REQUIRED_USE}
|
||||
dnscrypt? ( ssl )
|
||||
doh? ( ssl )
|
||||
doh3? ( ssl quic )
|
||||
ipcipher? ( ssl )
|
||||
quic? ( ssl )"
|
||||
|
||||
RDEPEND="acct-group/dnsdist
|
||||
acct-user/dnsdist
|
||||
bpf? ( dev-libs/libbpf:= )
|
||||
cdb? ( dev-db/tinycdb:= )
|
||||
dev-libs/boost:=
|
||||
sys-libs/libcap
|
||||
dev-libs/libedit
|
||||
dev-libs/libsodium:=
|
||||
dnstap? ( dev-libs/fstrm )
|
||||
doh? ( net-libs/nghttp2:= )
|
||||
doh3? ( net-libs/quiche:= )
|
||||
lmdb? ( dev-db/lmdb:= )
|
||||
quic? ( net-libs/quiche )
|
||||
regex? ( dev-libs/re2:= )
|
||||
snmp? ( net-analyzer/net-snmp:= )
|
||||
ssl? ( dev-libs/openssl:= )
|
||||
systemd? ( sys-apps/systemd:0= )
|
||||
xdp? ( net-libs/xdp-tools )
|
||||
${LUA_DEPS}
|
||||
"
|
||||
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="$(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
|
||||
virtual/pkgconfig
|
||||
yaml? ( ${RUST_DEPEND} )
|
||||
"
|
||||
|
||||
# special requirements for live
|
||||
if [[ ${PV} == *9999* ]] ; then
|
||||
BDEPEND+=" dev-util/ragel"
|
||||
S="${S}/pdns/dnsdistdist"
|
||||
fi
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/2.0.2-roundrobin-fast-path.patch
|
||||
"${FILESDIR}"/2.0.2-speed-up-cache-hits.patch
|
||||
"${FILESDIR}"/2.0.2-quiche-bbr.patch
|
||||
)
|
||||
|
||||
pkg_setup() {
|
||||
lua-single_pkg_setup
|
||||
python-any-r1_pkg_setup
|
||||
use yaml && rust_pkg_setup
|
||||
}
|
||||
|
||||
python_check_deps() {
|
||||
python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
|
||||
}
|
||||
|
||||
# git-r3 overrides automatic SRC_URI unpacking
|
||||
src_unpack() {
|
||||
default
|
||||
|
||||
if [[ ${PV} == *9999* ]] ; then
|
||||
git-r3_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# clean up duplicate file
|
||||
rm -f README.md
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# bug #822855
|
||||
append-lfs-flags
|
||||
|
||||
# There is currently no reliable way to handle mixed C++/Rust + LTO
|
||||
# correctly: https://bugs.gentoo.org/963128
|
||||
if use yaml && tc-is-lto ; then
|
||||
ewarn "Disabling LTO because of mixed C++/Rust toolchains."
|
||||
filter-lto
|
||||
fi
|
||||
|
||||
# some things can only be enabled/disabled by defines
|
||||
! use dnstap && append-cppflags -DDISABLE_PROTOBUF
|
||||
! use web && append-cppflags -DDISABLE_BUILTIN_HTML
|
||||
|
||||
local emesonargs=(
|
||||
--sysconfdir="${EPREFIX}/etc/dnsdist"
|
||||
# always use libsodium
|
||||
-Dlibsodium=enabled
|
||||
-Dlua=${ELUA}
|
||||
# never try to build man pages (virtualenv)
|
||||
-Dman-pages=false
|
||||
# never use gnutls (openssl only)
|
||||
-Dtls-gnutls=disabled
|
||||
$(meson_feature bpf ebpf)
|
||||
$(meson_feature cdb)
|
||||
$(meson_feature dnscrypt)
|
||||
$(meson_feature dnstap)
|
||||
$(meson_feature doh dns-over-https)
|
||||
$(meson_feature doh nghttp2)
|
||||
$(meson_feature doh3 dns-over-http3)
|
||||
$(meson_feature ipcipher)
|
||||
$(meson_feature lmdb)
|
||||
$(meson_feature quic dns-over-quic)
|
||||
$(meson_feature regex re2)
|
||||
$(meson_feature snmp)
|
||||
$(meson_feature ssl libcrypto)
|
||||
$(meson_feature ssl tls-libssl)
|
||||
$(meson_feature ssl dns-over-tls)
|
||||
$(meson_feature systemd systemd-service)
|
||||
$(meson_use test unit-tests)
|
||||
$(meson_feature xdp xsk)
|
||||
$(meson_feature yaml)
|
||||
)
|
||||
|
||||
meson_src_configure
|
||||
}
|
||||
|
||||
# explicitly implement src_compile/test to override the
|
||||
# otherwise automagic cargo_src_compile/test phases
|
||||
|
||||
src_compile() {
|
||||
cargo_gen_config
|
||||
cargo_env meson_src_compile
|
||||
}
|
||||
|
||||
src_test() {
|
||||
meson_src_test
|
||||
}
|
||||
|
||||
src_install() {
|
||||
meson_src_install
|
||||
|
||||
use doc && dodoc -r "${WORKDIR}"/html
|
||||
|
||||
insinto /etc/dnsdist
|
||||
doins "${FILESDIR}"/dnsdist.conf.example
|
||||
|
||||
newconfd "${FILESDIR}"/dnsdist.confd ${PN}
|
||||
newinitd "${FILESDIR}"/dnsdist.initd ${PN}
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "dnsdist provides multiple instances support. You can create more instances"
|
||||
elog "by symlinking the dnsdist init script to another name."
|
||||
elog
|
||||
elog "The name must be in the format dnsdist.<suffix> and dnsdist will use the"
|
||||
elog "/etc/dnsdist/dnsdist-<suffix>.conf configuration file instead of the default."
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
https://github.com/PowerDNS/pdns/pull/16867
|
||||
Fixed up patch paths to match distribution.
|
||||
|
||||
From: Remi Gacogne <remi.gacogne@powerdns.com>
|
||||
Date: Mon, 2 Feb 2026 15:16:20 +0100
|
||||
Subject: [PATCH] dnsdist: Work around Quiche not dealing well with removed congestion algorithms
|
||||
|
||||
See https://github.com/cloudflare/quiche/issues/2342
|
||||
|
||||
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
|
||||
(cherry picked from commit d677611e5855b7db1d940c85df8259ce98e481a7)
|
||||
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
|
||||
---
|
||||
pdns/dnsdistdist/dnsdist-configuration-yaml.cc | 8 ++------
|
||||
pdns/dnsdistdist/dnsdist-lua.cc | 14 ++------------
|
||||
pdns/dnsdistdist/doq-common.cc | 5 +----
|
||||
pdns/dnsdistdist/doq-common.hh | 7 -------
|
||||
4 files changed, 5 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc
|
||||
index ada7edc1e9d1..6e8b280fe0a1 100644
|
||||
--- a/dnsdist-configuration-yaml.cc
|
||||
+++ b/dnsdist-configuration-yaml.cc
|
||||
@@ -306,9 +306,7 @@ static bool handleTLSConfiguration(const dnsdist::rust::settings::BindConfigurat
|
||||
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);
|
||||
}
|
||||
@@ -320,9 +318,7 @@ static bool handleTLSConfiguration(const dnsdist::rust::settings::BindConfigurat
|
||||
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 b87e12692050..5a345aabec6a 100644
|
||||
--- a/dnsdist-lua.cc
|
||||
+++ b/dnsdist-lua.cc
|
||||
@@ -2348,12 +2348,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
|
||||
{
|
||||
std::string valueStr;
|
||||
if (getOptionalValue<std::string>(vars, "congestionControlAlgo", valueStr) > 0) {
|
||||
- if (dnsdist::doq::s_available_cc_algorithms.count(valueStr) > 0) {
|
||||
- frontend->d_quicheParams.d_ccAlgo = valueStr;
|
||||
- }
|
||||
- else {
|
||||
- warnlog("Ignoring unknown value '%s' for 'congestionControlAlgo' on 'addDOH3Local'", valueStr);
|
||||
- }
|
||||
+ frontend->d_quicheParams.d_ccAlgo = std::move(valueStr);
|
||||
}
|
||||
}
|
||||
parseTLSConfig(frontend->d_quicheParams.d_tlsConfig, "addDOH3Local", vars);
|
||||
@@ -2426,12 +2421,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
|
||||
{
|
||||
std::string valueStr;
|
||||
if (getOptionalValue<std::string>(vars, "congestionControlAlgo", valueStr) > 0) {
|
||||
- if (dnsdist::doq::s_available_cc_algorithms.count(valueStr) > 0) {
|
||||
- frontend->d_quicheParams.d_ccAlgo = std::move(valueStr);
|
||||
- }
|
||||
- else {
|
||||
- warnlog("Ignoring unknown value '%s' for 'congestionControlAlgo' on 'addDOQLocal'", 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 54a1d3effcd6..07c7ad8c91d1 100644
|
||||
--- a/doq-common.cc
|
||||
+++ b/doq-common.cc
|
||||
@@ -280,10 +280,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<enum quiche_cc_algorithm>(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 96f99dbfc9a0..0ba4c28e3231 100644
|
||||
--- a/doq-common.hh
|
||||
+++ b/doq-common.hh
|
||||
@@ -39,13 +39,6 @@
|
||||
|
||||
namespace dnsdist::doq
|
||||
{
|
||||
-
|
||||
-static const std::map<const std::string, int> s_available_cc_algorithms = {
|
||||
- {"reno", QUICHE_CC_RENO},
|
||||
- {"cubic", QUICHE_CC_CUBIC},
|
||||
- {"bbr", QUICHE_CC_BBR},
|
||||
-};
|
||||
-
|
||||
using QuicheConnection = std::unique_ptr<quiche_conn, decltype(&quiche_conn_free)>;
|
||||
using QuicheHTTP3Connection = std::unique_ptr<quiche_h3_conn, decltype(&quiche_h3_conn_free)>;
|
||||
using QuicheConfig = std::shared_ptr<quiche_config>;
|
||||
Reference in New Issue
Block a user