From 5f567a4e4291fc74daff08d2e03fdf10c15f04d7 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 19 Mar 2024 11:30:33 +0100 Subject: [PATCH] dnsdist: Fix clang-tidy warnings --- pdns/dnsdist.cc | 8 ++++---- pdns/dnsdist.hh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 7b421236cd..a08d273138 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1236,12 +1236,12 @@ static bool applyRulesToQuery(LocalHolders& holders, DNSQuestion& dq, const stru return true; } -ssize_t udpClientSendRequestToBackend(const std::shared_ptr& backend, const int sd, const PacketBuffer& request, bool healthCheck) +ssize_t udpClientSendRequestToBackend(const std::shared_ptr& backend, const int socketDesc, const PacketBuffer& request, bool healthCheck) { ssize_t result; if (backend->d_config.sourceItf == 0) { - result = send(sd, request.data(), request.size(), 0); + result = send(socketDesc, request.data(), request.size(), 0); } else { struct msghdr msgh; @@ -1249,8 +1249,8 @@ ssize_t udpClientSendRequestToBackend(const std::shared_ptr& ba cmsgbuf_aligned cbuf; ComboAddress remote(backend->d_config.remote); fillMSGHdr(&msgh, &iov, &cbuf, sizeof(cbuf), const_cast(reinterpret_cast(request.data())), request.size(), &remote); - addCMsgSrcAddr(&msgh, &cbuf, &backend->d_config.sourceAddr, backend->d_config.sourceItf); - result = sendmsg(sd, &msgh, 0); + addCMsgSrcAddr(&msgh, &cbuf, &backend->d_config.sourceAddr, static_cast(backend->d_config.sourceItf)); + result = sendmsg(socketDesc, &msgh, 0); } if (result == -1) { diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 19eb3c715a..777b27aaf7 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -1197,7 +1197,7 @@ bool processResponderPacket(std::shared_ptr& dss, PacketBuffer& bool assignOutgoingUDPQueryToBackend(std::shared_ptr& downstream, uint16_t queryID, DNSQuestion& dnsQuestion, PacketBuffer& query, bool actuallySend = true); -ssize_t udpClientSendRequestToBackend(const std::shared_ptr& ss, const int sd, const PacketBuffer& request, bool healthCheck = false); +ssize_t udpClientSendRequestToBackend(const std::shared_ptr& backend, const int socketDesc, const PacketBuffer& request, bool healthCheck = false); bool sendUDPResponse(int origFD, const PacketBuffer& response, const int delayMsec, const ComboAddress& origDest, const ComboAddress& origRemote); void handleResponseSent(const DNSName& qname, const QType& qtype, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, dnsdist::Protocol incomingProtocol, bool fromBackend); void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, bool fromBackend); -- 2.47.2