From: Remi Gacogne Date: Mon, 10 Nov 2025 12:59:55 +0000 (+0100) Subject: dnsdist: Fix review comments wrt YAML errors X-Git-Tag: rec-5.4.0-alpha1~91^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1d462da33595af9bfb2dc685373216b4b3d391e;p=thirdparty%2Fpdns.git dnsdist: Fix review comments wrt YAML errors Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc index c31033b3e3..774d360312 100644 --- a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc +++ b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc @@ -1226,13 +1226,16 @@ bool loadConfigurationFromFile(const std::string& fileName, [[maybe_unused]] boo if (!pool.packet_cache.empty()) { poolIt->second.packetCache = getRegisteredTypeByName(pool.packet_cache); + if (!poolIt->second.packetCache) { + throw std::runtime_error("Unable to find a cache named " + std::string(pool.packet_cache)); + } } if (!pool.policy.empty()) { auto policy = getRegisteredTypeByName(pool.policy); if (!policy) { throw std::runtime_error("Unable to find a load-balancing policy named " + std::string(pool.policy)); } - poolIt->second.policy = policy; + poolIt->second.policy = std::move(policy); } poolIt->second.setECS(pool.use_ecs); poolIt->second.setZeroScope(pool.use_zero_scope);