From cf4f4c371da5aa72400ead18e8ca775ac37e80f8 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 4 Dec 2025 10:09:19 +0100 Subject: [PATCH] dnsdist: Fix missed optimizations reported by Coverity in config This does not really matter because we don't care much about small performance gains in configuration parsing, but it makes Coverity happy. Signed-off-by: Remi Gacogne --- pdns/dnsdistdist/dnsdist-lua.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist-lua.cc b/pdns/dnsdistdist/dnsdist-lua.cc index 4acdd1934c..4f70538f1b 100644 --- a/pdns/dnsdistdist/dnsdist-lua.cc +++ b/pdns/dnsdistdist/dnsdist-lua.cc @@ -656,7 +656,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) } #endif /* HAVE_XSK */ if (autoUpgrade && ret->getProtocol() != dnsdist::Protocol::DoT && ret->getProtocol() != dnsdist::Protocol::DoH) { - dnsdist::ServiceDiscovery::addUpgradeableServer(ret, upgradeInterval, upgradePool, upgradeDoHKey, keepAfterUpgrade); + dnsdist::ServiceDiscovery::addUpgradeableServer(ret, upgradeInterval, std::move(upgradePool), upgradeDoHKey, keepAfterUpgrade); } /* this needs to be done _AFTER_ the order has been set, @@ -1724,7 +1724,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) checkAllParametersConsumed("setStructuredLogging", options); } - dnsdist::logging::LoggingConfiguration::setStructuredLogging(enable, levelPrefix); + dnsdist::logging::LoggingConfiguration::setStructuredLogging(enable, std::move(levelPrefix)); }); luaCtx.writeFunction("showBinds", []() { @@ -2356,7 +2356,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 = valueStr; + frontend->d_quicheParams.d_ccAlgo = std::move(valueStr); } else { warnlog("Ignoring unknown value '%s' for 'congestionControlAlgo' on 'addDOH3Local'", valueStr); @@ -2384,7 +2384,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) } auto clientState = std::make_shared(frontend->d_local, false, reusePort, tcpFastOpenQueueSize, interface, cpus, enableProxyProtocol); - clientState->doh3Frontend = frontend; + clientState->doh3Frontend = std::move(frontend); clientState->d_additionalAddresses = std::move(additionalAddresses); dnsdist::configuration::updateImmutableConfiguration([&clientState](dnsdist::configuration::ImmutableConfiguration& config) { @@ -2830,7 +2830,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) } // only works pre-startup, so no sync necessary auto clientState = std::make_shared(frontend->d_addr, true, reusePort, tcpFastOpenQueueSize, interface, cpus, enableProxyProtocol); - clientState->tlsFrontend = frontend; + clientState->tlsFrontend = std::move(frontend); clientState->d_additionalAddresses = std::move(additionalAddresses); if (tcpListenQueueSize > 0) { clientState->tcpListenQueueSize = tcpListenQueueSize; -- 2.47.3