From: Otto Moerbeek Date: Tue, 2 Apr 2024 15:11:41 +0000 (+0200) Subject: Reorder fields of DNSQuestion to avoid gaps X-Git-Tag: rec-5.1.0-alpha1~30^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=769c422fe8b4460af2f1b35f0d2efc2510267f0c;p=thirdparty%2Fpdns.git Reorder fields of DNSQuestion to avoid gaps --- diff --git a/pdns/recursordist/lua-recursor4.hh b/pdns/recursordist/lua-recursor4.hh index 2288b17706..263d2a9392 100644 --- a/pdns/recursordist/lua-recursor4.hh +++ b/pdns/recursordist/lua-recursor4.hh @@ -88,18 +88,16 @@ public: { // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) DNSQuestion(const ComboAddress& prem, const ComboAddress& ploc, const ComboAddress& rem, const ComboAddress& loc, const DNSName& query, uint16_t type, bool tcp, bool& variable_, bool& wantsRPZ_, bool& logResponse_, bool& addPaddingToResponse_, const struct timeval& queryTime_) : - qname(query), qtype(type), phys_local(ploc), phys_remote(prem), local(loc), remote(rem), isTcp(tcp), variable(variable_), wantsRPZ(wantsRPZ_), logResponse(logResponse_), addPaddingToResponse(addPaddingToResponse_), queryTime(queryTime_) + qname(query), phys_local(ploc), phys_remote(prem), local(loc), remote(rem), variable(variable_), wantsRPZ(wantsRPZ_), logResponse(logResponse_), addPaddingToResponse(addPaddingToResponse_), queryTime(queryTime_), qtype(type), isTcp(tcp) { } const DNSName& qname; - const uint16_t qtype; const ComboAddress& phys_local; const ComboAddress& phys_remote; const ComboAddress& local; const ComboAddress& remote; const ComboAddress* fromAuthIP{nullptr}; const struct dnsheader* dh{nullptr}; - const bool isTcp; const std::vector>* ednsOptions{nullptr}; const uint16_t* ednsFlags{nullptr}; vector* currentRecords{nullptr}; @@ -112,41 +110,43 @@ public: std::string requestorId; std::string deviceId; std::string deviceName; - vState validationState{vState::Indeterminate}; bool& variable; bool& wantsRPZ; bool& logResponse; bool& addPaddingToResponse; - unsigned int tag{0}; std::map meta; struct timeval queryTime; - void addAnswer(uint16_t type, const std::string& content, boost::optional ttl, boost::optional name); - void addRecord(uint16_t type, const std::string& content, DNSResourceRecord::Place place, boost::optional ttl, boost::optional name); - [[nodiscard]] vector> getRecords() const; - [[nodiscard]] boost::optional getDH() const; - [[nodiscard]] vector> getEDNSOptions() const; - [[nodiscard]] boost::optional getEDNSOption(uint16_t code) const; - [[nodiscard]] boost::optional getEDNSSubnet() const; - [[nodiscard]] std::vector> getProxyProtocolValues() const; - [[nodiscard]] vector getEDNSFlags() const; - [[nodiscard]] bool getEDNSFlag(const string& flag) const; - void setRecords(const vector>& arg); - - int rcode{0}; - // struct dnsheader, packet length would be great vector records; string followupFunction; string followupPrefix; string udpQuery; - ComboAddress udpQueryDest; string udpAnswer; string udpCallback; LuaContext::LuaObject data; DNSName followupName; + ComboAddress udpQueryDest; + + unsigned int tag{0}; + int rcode{0}; + const uint16_t qtype; + const bool isTcp; + vState validationState{vState::Indeterminate}; + + void addAnswer(uint16_t type, const std::string& content, boost::optional ttl, boost::optional name); + void addRecord(uint16_t type, const std::string& content, DNSResourceRecord::Place place, boost::optional ttl, boost::optional name); + [[nodiscard]] vector> getRecords() const; + [[nodiscard]] boost::optional getDH() const; + [[nodiscard]] vector> getEDNSOptions() const; + [[nodiscard]] boost::optional getEDNSOption(uint16_t code) const; + [[nodiscard]] boost::optional getEDNSSubnet() const; + [[nodiscard]] std::vector> getProxyProtocolValues() const; + [[nodiscard]] vector getEDNSFlags() const; + [[nodiscard]] bool getEDNSFlag(const string& flag) const; + void setRecords(const vector>& arg); }; struct PolicyEvent