From: Remi Gacogne Date: Tue, 21 Feb 2017 15:22:12 +0000 (+0100) Subject: rec: Clean up the signedness of the packet cache's tag X-Git-Tag: rec-4.1.0-alpha1~229^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b673817afdbf5ea0ad155f0e9408498ed9f9fcb7;p=thirdparty%2Fpdns.git rec: Clean up the signedness of the packet cache's tag --- diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index 0749e30b7a..7cf7d921de 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -73,7 +73,7 @@ bool RecursorLua4::ipfilter(const ComboAddress& remote, const ComboAddress& loca return false; } -int RecursorLua4::gettag(const ComboAddress& remote, const Netmask& ednssubnet, const ComboAddress& local, const DNSName& qname, uint16_t qtype, std::vector* policyTags, std::unordered_map& data) +unsigned int RecursorLua4::gettag(const ComboAddress& remote, const Netmask& ednssubnet, const ComboAddress& local, const DNSName& qname, uint16_t qtype, std::vector* policyTags, std::unordered_map& data) { return 0; } @@ -635,7 +635,7 @@ bool RecursorLua4::ipfilter(const ComboAddress& remote, const ComboAddress& loca return false; // don't block } -int RecursorLua4::gettag(const ComboAddress& remote, const Netmask& ednssubnet, const ComboAddress& local, const DNSName& qname, uint16_t qtype, std::vector* policyTags, std::unordered_map& data) +unsigned int RecursorLua4::gettag(const ComboAddress& remote, const Netmask& ednssubnet, const ComboAddress& local, const DNSName& qname, uint16_t qtype, std::vector* policyTags, std::unordered_map& data) { if(d_gettag) { auto ret = d_gettag(remote, ednssubnet, local, qname, qtype); diff --git a/pdns/lua-recursor4.hh b/pdns/lua-recursor4.hh index efc7ac5997..0339e18eb2 100644 --- a/pdns/lua-recursor4.hh +++ b/pdns/lua-recursor4.hh @@ -65,7 +65,7 @@ public: std::unordered_map* discardedPolicies{nullptr}; bool& variable; bool& wantsRPZ; - int tag{0}; + unsigned int tag{0}; #ifdef HAVE_LUA void addAnswer(uint16_t type, const std::string& content, boost::optional ttl, boost::optional name); @@ -96,7 +96,7 @@ public: #endif }; - int gettag(const ComboAddress& remote, const Netmask& ednssubnet, const ComboAddress& local, const DNSName& qname, uint16_t qtype, std::vector* policyTags, std::unordered_map& data); + unsigned int gettag(const ComboAddress& remote, const Netmask& ednssubnet, const ComboAddress& local, const DNSName& qname, uint16_t qtype, std::vector* policyTags, std::unordered_map& data); bool prerpz(DNSQuestion& dq, int& ret); bool preresolve(DNSQuestion& dq, int& ret); @@ -116,7 +116,8 @@ public: d_postresolve); } - typedef std::function >,boost::optional > >(ComboAddress, Netmask, ComboAddress, DNSName, uint16_t)> gettag_t; + typedef std::function >,boost::optional > >(ComboAddress, Netmask, ComboAddress, DNSName, +uint16_t)> gettag_t; gettag_t d_gettag; // public so you can query if we have this hooked private: diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 048f4b5ff1..e0d4b92850 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -204,7 +204,7 @@ struct DNSComboWriter { bool d_ecsParsed{false}; bool d_tcp; int d_socket; - int d_tag{0}; + unsigned int d_tag{0}; uint32_t d_qhash{0}; string d_query; shared_ptr d_tcpConnection;