Skip to content

Commit

Permalink
dnsdist: Fix more "unused parameters" warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Jan 28, 2025
1 parent a95b899 commit 41cd3ec
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 47 deletions.
4 changes: 4 additions & 0 deletions pdns/dnsdistdist/bpf-filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,9 @@ uint64_t BPFFilter::getHits(const ComboAddress& requestor)

BPFFilter::BPFFilter(std::unordered_map<std::string, MapConfiguration>& configs, BPFFilter::MapFormat format, bool external)
{
(void)configs;
(void)format;
(void)external;
}

void BPFFilter::addSocket(int)
Expand Down Expand Up @@ -972,6 +975,7 @@ bool BPFFilter::supportsMatchAction(MatchAction action) const
}
return d_mapFormat == BPFFilter::MapFormat::WithActions;
#endif /* HAVE_EBPF */
(void)action;
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-internal-queries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ std::unique_ptr<CrossProtocolQuery> getUDPCrossProtocolQueryFromDQ(DNSQuestion&

namespace dnsdist
{
std::unique_ptr<CrossProtocolQuery> getInternalQueryFromDQ(DNSQuestion& dnsQuestion, bool isResponse)
std::unique_ptr<CrossProtocolQuery> getInternalQueryFromDQ(DNSQuestion& dnsQuestion, [[maybe_unused]] bool isResponse)
{
auto protocol = dnsQuestion.getProtocol();
if (protocol == dnsdist::Protocol::DoUDP || protocol == dnsdist::Protocol::DNSCryptUDP) {
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-lua-bindings-dnscrypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "dolog.hh"

void setupLuaBindingsDNSCrypt(LuaContext& luaCtx, bool client)
void setupLuaBindingsDNSCrypt([[maybe_unused]] LuaContext& luaCtx, [[maybe_unused]] bool client)
{
#ifdef HAVE_DNSCRYPT
/* DNSCryptContext bindings */
Expand Down
6 changes: 3 additions & 3 deletions pdns/dnsdistdist/dnsdist-lua-bindings-dnsquestion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "dnsparser.hh"

// NOLINTNEXTLINE(readability-function-cognitive-complexity): this function declares Lua bindings, even with a good refactoring it will likely blow up the threshold
void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
void setupLuaBindingsDNSQuestion([[maybe_unused]] LuaContext& luaCtx)
{
#ifndef DISABLE_NON_FFI_DQ_BINDINGS
/* DNSQuestion */
Expand Down Expand Up @@ -173,7 +173,7 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
return dnsQuestion.ids.queryRealTime.udiff();
});

luaCtx.registerFunction<void (DNSQuestion::*)(std::string)>("sendTrap", [](const DNSQuestion& dnsQuestion, boost::optional<std::string> reason) {
luaCtx.registerFunction<void (DNSQuestion::*)(std::string)>("sendTrap", []([[maybe_unused]] const DNSQuestion& dnsQuestion, [[maybe_unused]] boost::optional<std::string> reason) {
#ifdef HAVE_NET_SNMP
if (g_snmpAgent != nullptr && dnsdist::configuration::getImmutableConfiguration().d_snmpTrapsEnabled) {
g_snmpAgent->sendDNSTrap(dnsQuestion, reason ? *reason : "");
Expand Down Expand Up @@ -501,7 +501,7 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
return dnsResponse.ids.queryRealTime.udiff();
});

luaCtx.registerFunction<void (DNSResponse::*)(std::string)>("sendTrap", [](const DNSResponse& dnsResponse, boost::optional<std::string> reason) {
luaCtx.registerFunction<void (DNSResponse::*)(std::string)>("sendTrap", []([[maybe_unused]] const DNSResponse& dnsResponse, [[maybe_unused]] boost::optional<std::string> reason) {
#ifdef HAVE_NET_SNMP
if (g_snmpAgent != nullptr && dnsdist::configuration::getImmutableConfiguration().d_snmpTrapsEnabled) {
g_snmpAgent->sendDNSTrap(dnsResponse, reason ? *reason : "");
Expand Down
4 changes: 2 additions & 2 deletions pdns/dnsdistdist/dnsdist-lua-bindings-protobuf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void setupLuaBindingsProtoBuf(LuaContext& luaCtx, bool client, bool configCheck)
return std::shared_ptr<RemoteLoggerInterface>(new RemoteLogger(ComboAddress(remote), timeout ? *timeout : 2, maxQueuedEntries ? (*maxQueuedEntries*100) : 10000, reconnectWaitTime ? *reconnectWaitTime : 1, client));
});

luaCtx.writeFunction("newFrameStreamUnixLogger", [client,configCheck](const std::string& address, boost::optional<LuaAssociativeTable<unsigned int>> params) {
luaCtx.writeFunction("newFrameStreamUnixLogger", [client,configCheck]([[maybe_unused]] const std::string& address, [[maybe_unused]] boost::optional<LuaAssociativeTable<unsigned int>> params) {
#ifdef HAVE_FSTRM
if (client || configCheck) {
return std::shared_ptr<RemoteLoggerInterface>(nullptr);
Expand All @@ -143,7 +143,7 @@ void setupLuaBindingsProtoBuf(LuaContext& luaCtx, bool client, bool configCheck)
#endif /* HAVE_FSTRM */
});

luaCtx.writeFunction("newFrameStreamTcpLogger", [client,configCheck](const std::string& address, boost::optional<LuaAssociativeTable<unsigned int>> params) {
luaCtx.writeFunction("newFrameStreamTcpLogger", [client,configCheck]([[maybe_unused]] const std::string& address, [[maybe_unused]] boost::optional<LuaAssociativeTable<unsigned int>> params) {
#if defined(HAVE_FSTRM) && defined(HAVE_FSTRM_TCP_WRITER_INIT)
if (client || configCheck) {
return std::shared_ptr<RemoteLoggerInterface>(nullptr);
Expand Down
4 changes: 2 additions & 2 deletions pdns/dnsdistdist/dnsdist-lua-ffi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ size_t dnsdist_ffi_dnsquestion_get_edns_options(dnsdist_ffi_dnsquestion_t* dq, c
return totalCount;
}

size_t dnsdist_ffi_dnsquestion_get_http_headers(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_http_header_t** out)
size_t dnsdist_ffi_dnsquestion_get_http_headers(dnsdist_ffi_dnsquestion_t* dq, [[maybe_unused]] const dnsdist_ffi_http_header_t** out)
{
#if defined(HAVE_DNS_OVER_HTTPS) || defined(HAVE_DNS_OVER_HTTP3)
const auto processHeaders = [&dq](const std::unordered_map<std::string, std::string>& headers) {
Expand Down Expand Up @@ -498,7 +498,7 @@ void dnsdist_ffi_dnsquestion_set_result(dnsdist_ffi_dnsquestion_t* dq, const cha
dq->result = std::string(str, strSize);
}

void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, uint16_t statusCode, const char* body, size_t bodyLen, const char* contentType)
void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, [[maybe_unused]] uint16_t statusCode, [[maybe_unused]] const char* body, [[maybe_unused]] size_t bodyLen, [[maybe_unused]] const char* contentType)
{
#if defined(HAVE_DNS_OVER_HTTPS)
if (dq->dq->ids.du) {
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-lua-web.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace dnsdist::webserver
void registerWebHandler(const std::string& endpoint, std::function<void(const YaHTTP::Request&, YaHTTP::Response&)> handler, bool isLua);
}

void setupLuaWeb(LuaContext& luaCtx)
void setupLuaWeb([[maybe_unused]] LuaContext& luaCtx)
{
#ifndef DISABLE_LUA_WEB_HANDLERS
luaCtx.writeFunction("registerWebHandler", [](const std::string& path, std::function<void(const YaHTTP::Request*, YaHTTP::Response*)> handler) {
Expand Down
18 changes: 9 additions & 9 deletions pdns/dnsdistdist/dnsdist-lua.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2118,7 +2118,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
});

typedef std::unordered_map<std::string, std::string> tlscertificateopts_t;
luaCtx.writeFunction("newTLSCertificate", [client](const std::string& cert, boost::optional<tlscertificateopts_t> opts) {
luaCtx.writeFunction("newTLSCertificate", [client]([[maybe_unused]] const std::string& cert, [[maybe_unused]] boost::optional<tlscertificateopts_t> opts) {
std::shared_ptr<TLSCertKeyPair> result = nullptr;
if (client) {
return result;
Expand All @@ -2139,7 +2139,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
return result;
});

luaCtx.writeFunction("addDOHLocal", [client](const std::string& addr, boost::optional<boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>> certFiles, boost::optional<LuaTypeOrArrayOf<std::string>> keyFiles, boost::optional<LuaTypeOrArrayOf<std::string>> urls, boost::optional<localbind_t> vars) {
luaCtx.writeFunction("addDOHLocal", [client]([[maybe_unused]] const std::string& addr, [[maybe_unused]] boost::optional<boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>> certFiles, [[maybe_unused]] boost::optional<LuaTypeOrArrayOf<std::string>> keyFiles, [[maybe_unused]] boost::optional<LuaTypeOrArrayOf<std::string>> urls, [[maybe_unused]] boost::optional<localbind_t> vars) {
if (client) {
return;
}
Expand Down Expand Up @@ -2307,7 +2307,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
});

// NOLINTNEXTLINE(performance-unnecessary-value-param): somehow clang-tidy gets confused about the fact vars could be const while it cannot
luaCtx.writeFunction("addDOH3Local", [client](const std::string& addr, const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, const LuaTypeOrArrayOf<std::string>& keyFiles, boost::optional<localbind_t> vars) {
luaCtx.writeFunction("addDOH3Local", [client]([[maybe_unused]] const std::string& addr, [[maybe_unused]] const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, [[maybe_unused]] const LuaTypeOrArrayOf<std::string>& keyFiles, [[maybe_unused]] boost::optional<localbind_t> vars) {
if (client) {
return;
}
Expand Down Expand Up @@ -2384,7 +2384,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
});

// NOLINTNEXTLINE(performance-unnecessary-value-param): somehow clang-tidy gets confused about the fact vars could be const while it cannot
luaCtx.writeFunction("addDOQLocal", [client](const std::string& addr, const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, const LuaTypeOrArrayOf<std::string>& keyFiles, boost::optional<localbind_t> vars) {
luaCtx.writeFunction("addDOQLocal", [client]([[maybe_unused]] const std::string& addr, [[maybe_unused]] const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, [[maybe_unused]] const LuaTypeOrArrayOf<std::string>& keyFiles, [[maybe_unused]] boost::optional<localbind_t> vars) {
if (client) {
return;
}
Expand Down Expand Up @@ -2635,7 +2635,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
#endif
});

luaCtx.writeFunction("getDOHFrontend", [client](uint64_t index) {
luaCtx.writeFunction("getDOHFrontend", [client]([[maybe_unused]] uint64_t index) {
std::shared_ptr<DOHFrontend> result = nullptr;
if (client) {
return result;
Expand Down Expand Up @@ -2673,7 +2673,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
}
});

luaCtx.registerFunction<void (std::shared_ptr<DOHFrontend>::*)(boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>> certFiles, LuaTypeOrArrayOf<std::string> keyFiles)>("loadNewCertificatesAndKeys", [](const std::shared_ptr<DOHFrontend>& frontend, const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, const LuaTypeOrArrayOf<std::string>& keyFiles) {
luaCtx.registerFunction<void (std::shared_ptr<DOHFrontend>::*)(boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>> certFiles, LuaTypeOrArrayOf<std::string> keyFiles)>("loadNewCertificatesAndKeys", []([[maybe_unused]] const std::shared_ptr<DOHFrontend>& frontend, [[maybe_unused]] const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, [[maybe_unused]] const LuaTypeOrArrayOf<std::string>& keyFiles) {
#ifdef HAVE_DNS_OVER_HTTPS
if (frontend != nullptr) {
if (loadTLSCertificateAndKeys("DOHFrontend::loadNewCertificatesAndKeys", frontend->d_tlsContext.d_tlsConfig.d_certKeyPairs, certFiles, keyFiles)) {
Expand Down Expand Up @@ -2736,7 +2736,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
}
});

luaCtx.writeFunction("addTLSLocal", [client](const std::string& addr, const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, const LuaTypeOrArrayOf<std::string>& keyFiles, boost::optional<localbind_t> vars) {
luaCtx.writeFunction("addTLSLocal", [client]([[maybe_unused]] const std::string& addr, [[maybe_unused]] const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, [[maybe_unused]] const LuaTypeOrArrayOf<std::string>& keyFiles, [[maybe_unused]] boost::optional<localbind_t> vars) {
if (client) {
return;
}
Expand Down Expand Up @@ -2864,7 +2864,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
#endif
});

luaCtx.writeFunction("getTLSFrontend", [](uint64_t index) {
luaCtx.writeFunction("getTLSFrontend", []([[maybe_unused]] uint64_t index) {
std::shared_ptr<TLSFrontend> result = nullptr;
#ifdef HAVE_DNS_OVER_TLS
setLuaNoSideEffect();
Expand Down Expand Up @@ -2937,7 +2937,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
frontend->setupTLS();
});

luaCtx.registerFunction<void (std::shared_ptr<TLSFrontend>::*)(const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>&, const LuaTypeOrArrayOf<std::string>&)>("loadNewCertificatesAndKeys", [](std::shared_ptr<TLSFrontend>& frontend, const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, const LuaTypeOrArrayOf<std::string>& keyFiles) {
luaCtx.registerFunction<void (std::shared_ptr<TLSFrontend>::*)(const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>&, const LuaTypeOrArrayOf<std::string>&)>("loadNewCertificatesAndKeys", []([[maybe_unused]] std::shared_ptr<TLSFrontend>& frontend, [[maybe_unused]] const boost::variant<std::string, std::shared_ptr<TLSCertKeyPair>, LuaArray<std::string>, LuaArray<std::shared_ptr<TLSCertKeyPair>>>& certFiles, [[maybe_unused]] const LuaTypeOrArrayOf<std::string>& keyFiles) {
#ifdef HAVE_DNS_OVER_TLS
if (loadTLSCertificateAndKeys("TLSFrontend::loadNewCertificatesAndKeys", frontend->d_tlsConfig.d_certKeyPairs, certFiles, keyFiles)) {
frontend->setupTLS();
Expand Down
10 changes: 5 additions & 5 deletions pdns/dnsdistdist/dnsdist-nghttp2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ bool initDoHWorkers()
#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */
}

bool sendH2Query(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, std::shared_ptr<TCPQuerySender>& sender, InternalQuery&& query, bool healthCheck)
bool sendH2Query([[maybe_unused]] const std::shared_ptr<DownstreamState>& ds, [[maybe_unused]] std::unique_ptr<FDMultiplexer>& mplexer, [[maybe_unused]] std::shared_ptr<TCPQuerySender>& sender, [[maybe_unused]] InternalQuery&& query, [[maybe_unused]] bool healthCheck)
{
#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2)
struct timeval now
Expand Down Expand Up @@ -1080,7 +1080,7 @@ size_t clearH2Connections()
return cleared;
}

size_t handleH2Timeouts(FDMultiplexer& mplexer, const struct timeval& now)
size_t handleH2Timeouts([[maybe_unused]] FDMultiplexer& mplexer, [[maybe_unused]] const struct timeval& now)
{
size_t got = 0;
#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2)
Expand All @@ -1107,21 +1107,21 @@ size_t handleH2Timeouts(FDMultiplexer& mplexer, const struct timeval& now)
return got;
}

void setDoHDownstreamCleanupInterval(uint16_t max)
void setDoHDownstreamCleanupInterval([[maybe_unused]] uint16_t max)
{
#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2)
DownstreamDoHConnectionsManager::setCleanupInterval(max);
#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */
}

void setDoHDownstreamMaxIdleTime(uint16_t max)
void setDoHDownstreamMaxIdleTime([[maybe_unused]] uint16_t max)
{
#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2)
DownstreamDoHConnectionsManager::setMaxIdleTime(max);
#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */
}

void setDoHDownstreamMaxIdleConnectionsPerBackend(size_t max)
void setDoHDownstreamMaxIdleConnectionsPerBackend([[maybe_unused]] size_t max)
{
#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2)
DownstreamDoHConnectionsManager::setMaxIdleConnectionsPerDownstream(max);
Expand Down
6 changes: 3 additions & 3 deletions pdns/dnsdistdist/dnsdist-snmp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static int backendStatTable_handler(netsnmp_mib_handler* handler,
}
#endif /* HAVE_NET_SNMP */

bool DNSDistSNMPAgent::sendBackendStatusChangeTrap(const DownstreamState& dss)
bool DNSDistSNMPAgent::sendBackendStatusChangeTrap([[maybe_unused]] const DownstreamState& dss)
{
#ifdef HAVE_NET_SNMP
const string backendAddress = dss.d_config.remote.toStringWithPort();
Expand Down Expand Up @@ -432,7 +432,7 @@ bool DNSDistSNMPAgent::sendBackendStatusChangeTrap(const DownstreamState& dss)
#endif /* HAVE_NET_SNMP */
}

bool DNSDistSNMPAgent::sendCustomTrap(const std::string& reason)
bool DNSDistSNMPAgent::sendCustomTrap([[maybe_unused]] const std::string& reason)
{
#ifdef HAVE_NET_SNMP
netsnmp_variable_list* varList = nullptr;
Expand All @@ -454,7 +454,7 @@ bool DNSDistSNMPAgent::sendCustomTrap(const std::string& reason)
#endif /* HAVE_NET_SNMP */
}

bool DNSDistSNMPAgent::sendDNSTrap(const DNSQuestion& dnsQuestion, const std::string& reason)
bool DNSDistSNMPAgent::sendDNSTrap([[maybe_unused]] const DNSQuestion& dnsQuestion, [[maybe_unused]] const std::string& reason)
{
#ifdef HAVE_NET_SNMP
std::string local = dnsQuestion.ids.origDest.toString();
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-web.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class WebClientConnection
Socket d_socket;
};

bool addMetricDefinition(const dnsdist::prometheus::PrometheusMetricDefinition& def)
bool addMetricDefinition([[maybe_unused]] const dnsdist::prometheus::PrometheusMetricDefinition& def)
{
#ifndef DISABLE_PROMETHEUS
return MetricDefinitionStorage::addMetricDefinition(def);
Expand Down
8 changes: 4 additions & 4 deletions pdns/dnsdistdist/dnsdist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ bool applyRulesToResponse(const std::vector<dnsdist::rules::ResponseRuleAction>&
return true;
}

bool processResponseAfterRules(PacketBuffer& response, DNSResponse& dnsResponse, bool muted)
bool processResponseAfterRules(PacketBuffer& response, DNSResponse& dnsResponse, [[maybe_unused]] bool muted)
{
bool zeroScope = false;
if (!fixUpResponse(response, dnsResponse.ids.qname, dnsResponse.ids.origFlags, dnsResponse.ids.ednsAdded, dnsResponse.ids.ecsAdded, dnsResponse.ids.useZeroScope ? &zeroScope : nullptr)) {
Expand Down Expand Up @@ -584,7 +584,7 @@ static size_t getMaximumIncomingPacketSize(const ClientState& clientState)
return dnsdist::configuration::s_udpIncomingBufferSize + runtimeConfig.d_proxyProtocolMaximumSize;
}

bool sendUDPResponse(int origFD, const PacketBuffer& response, const int delayMsec, const ComboAddress& origDest, const ComboAddress& origRemote)
bool sendUDPResponse(int origFD, const PacketBuffer& response, [[maybe_unused]] const int delayMsec, const ComboAddress& origDest, const ComboAddress& origRemote)
{
#ifndef DISABLE_DELAY_PIPE
if (delayMsec > 0 && g_delay != nullptr) {
Expand Down Expand Up @@ -1266,7 +1266,7 @@ static bool isUDPQueryAcceptable(ClientState& clientState, const struct msghdr*
return true;
}

bool checkDNSCryptQuery(const ClientState& clientState, PacketBuffer& query, std::unique_ptr<DNSCryptQuery>& dnsCryptQuery, time_t now, bool tcp)
bool checkDNSCryptQuery(const ClientState& clientState, [[maybe_unused]] PacketBuffer& query, [[maybe_unused]] std::unique_ptr<DNSCryptQuery>& dnsCryptQuery, [[maybe_unused]] time_t now, [[maybe_unused]] bool tcp)
{
if (clientState.dnscryptCtx) {
#ifdef HAVE_DNSCRYPT
Expand Down Expand Up @@ -1332,7 +1332,7 @@ struct mmsghdr
#endif

/* self-generated responses or cache hits */
static bool prepareOutgoingResponse(const ClientState& clientState, DNSQuestion& dnsQuestion, bool cacheHit)
static bool prepareOutgoingResponse([[maybe_unused]] const ClientState& clientState, DNSQuestion& dnsQuestion, bool cacheHit)
{
std::shared_ptr<DownstreamState> backend{nullptr};
DNSResponse dnsResponse(dnsQuestion.ids, dnsQuestion.getMutableData(), backend);
Expand Down
2 changes: 1 addition & 1 deletion pdns/libssl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ bool OpenSSLTLSTicketKey::decrypt(const unsigned char* iv, EVP_CIPHER_CTX* ectx,
}

std::pair<std::unique_ptr<SSL_CTX, decltype(&SSL_CTX_free)>, std::vector<std::string>> libssl_init_server_context(const TLSConfig& config,
std::map<int, std::string>& ocspResponses)
[[maybe_unused]] std::map<int, std::string>& ocspResponses)
{
std::vector<std::string> warnings;
auto ctx = std::unique_ptr<SSL_CTX, decltype(&SSL_CTX_free)>(SSL_CTX_new(SSLv23_server_method()), SSL_CTX_free);
Expand Down
Loading

0 comments on commit 41cd3ec

Please sign in to comment.