summaryrefslogtreecommitdiffstats
path: root/dnsdist-discovery.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dnsdist-discovery.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/dnsdist-discovery.cc b/dnsdist-discovery.cc
index 76042e3..bba713b 100644
--- a/dnsdist-discovery.cc
+++ b/dnsdist-discovery.cc
@@ -38,7 +38,7 @@ const uint16_t ServiceDiscovery::s_defaultDoHSVCKey{7};
bool ServiceDiscovery::addUpgradeableServer(std::shared_ptr<DownstreamState>& server, uint32_t interval, std::string poolAfterUpgrade, uint16_t dohSVCKey, bool keepAfterUpgrade)
{
- s_upgradeableBackends.lock()->push_back(std::make_shared<UpgradeableBackend>(UpgradeableBackend{server, poolAfterUpgrade, 0, interval, dohSVCKey, keepAfterUpgrade}));
+ s_upgradeableBackends.lock()->push_back(std::make_shared<UpgradeableBackend>(UpgradeableBackend{server, std::move(poolAfterUpgrade), 0, interval, dohSVCKey, keepAfterUpgrade}));
return true;
}
@@ -52,7 +52,7 @@ struct DesignatedResolvers
static bool parseSVCParams(const PacketBuffer& answer, std::map<uint16_t, DesignatedResolvers>& resolvers)
{
std::map<DNSName, std::vector<ComboAddress>> hints;
- const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(answer.data());
+ const dnsheader_aligned dh(answer.data());
PacketReader pr(std::string_view(reinterpret_cast<const char*>(answer.data()), answer.size()));
uint16_t qdcount = ntohs(dh->qdcount);
uint16_t ancount = ntohs(dh->ancount);
@@ -226,7 +226,7 @@ static bool handleSVCResult(const PacketBuffer& answer, const ComboAddress& exis
tempConfig.d_subjectName = resolver.target.toStringNoDot();
tempConfig.d_addr.sin4.sin_port = tempConfig.d_port;
- config = tempConfig;
+ config = std::move(tempConfig);
return true;
}