From: Remi Gacogne Date: Tue, 7 Oct 2025 11:40:14 +0000 (+0200) Subject: dnsdist: Yet another clang-tidy fix X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15924%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Yet another clang-tidy fix Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-backend.cc b/pdns/dnsdistdist/dnsdist-backend.cc index 701564e96f..b55d2441a8 100644 --- a/pdns/dnsdistdist/dnsdist-backend.cc +++ b/pdns/dnsdistdist/dnsdist-backend.cc @@ -460,8 +460,8 @@ void DownstreamState::handleUDPTimeout(IDState& ids) } if (g_rings.shouldRecordResponses()) { - timespec ts{}; - gettime(&ts); + timespec now{}; + gettime(&now); dnsheader fake{}; memset(&fake, 0, sizeof(fake)); @@ -469,7 +469,7 @@ void DownstreamState::handleUDPTimeout(IDState& ids) uint16_t* flags = getFlagsFromDNSHeader(&fake); *flags = ids.internal.origFlags; - g_rings.insertResponse(ts, ids.internal.origRemote, ids.internal.qname, ids.internal.qtype, std::numeric_limits::max(), 0, fake, d_config.remote, getProtocol()); + g_rings.insertResponse(now, ids.internal.origRemote, ids.internal.qname, ids.internal.qtype, std::numeric_limits::max(), 0, fake, d_config.remote, getProtocol()); } reportTimeoutOrError(); diff --git a/pdns/dnsdistdist/dnsdist-lbpolicies.cc b/pdns/dnsdistdist/dnsdist-lbpolicies.cc index fc23139186..5bb8648c33 100644 --- a/pdns/dnsdistdist/dnsdist-lbpolicies.cc +++ b/pdns/dnsdistdist/dnsdist-lbpolicies.cc @@ -116,7 +116,7 @@ template static std::optional ge return std::nullopt; } - int randomVal = val % sum; + int randomVal = static_cast(val % sum); auto selected = std::upper_bound(poss.begin(), poss.begin() + usableServers, randomVal, [](int randomVal_, const typename T::value_type& serverPair) { return randomVal_ < serverPair.first;}); if (selected == poss.begin() + usableServers) { return std::nullopt;