From: Remi Gacogne Date: Fri, 2 Dec 2022 14:29:45 +0000 (+0100) Subject: dnsdist: Remove ttlCapTypes from the internal state X-Git-Tag: dnsdist-1.8.0-rc1~120^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1791a59d8d3e9f27691f8beec885d64a39cd286;p=thirdparty%2Fpdns.git dnsdist: Remove ttlCapTypes from the internal state --- diff --git a/pdns/dnsdist-idstate.hh b/pdns/dnsdist-idstate.hh index e90bf953c2..5b42f986f5 100644 --- a/pdns/dnsdist-idstate.hh +++ b/pdns/dnsdist-idstate.hh @@ -117,7 +117,6 @@ struct InternalQueryState InternalQueryState& operator=(const InternalQueryState& orig) = delete; boost::optional subnet{boost::none}; // 40 - std::unordered_set ttlCapTypes; ComboAddress origRemote; // 28 ComboAddress origDest; // 28 ComboAddress hopRemote; diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 2faeede4e1..2956826488 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -554,7 +554,7 @@ bool processResponse(PacketBuffer& response, const std::vector 0) { std::string result; - LimitTTLResponseAction ac(0, dr.ids.ttlCap, dr.ids.ttlCapTypes); + LimitTTLResponseAction ac(0, dr.ids.ttlCap, {}); ac(&dr, &result); } @@ -1226,7 +1226,7 @@ static bool prepareOutgoingResponse(LocalHolders& holders, ClientState& cs, DNSQ if (dr.ids.ttlCap > 0) { std::string result; - LimitTTLResponseAction ac(0, dr.ids.ttlCap, dr.ids.ttlCapTypes); + LimitTTLResponseAction ac(0, dr.ids.ttlCap, {}); ac(&dr, &result); } diff --git a/pdns/dnsdistdist/dnsdist-lua-ffi-interface.h b/pdns/dnsdistdist/dnsdist-lua-ffi-interface.h index ee61517028..3a509058a2 100644 --- a/pdns/dnsdistdist/dnsdist-lua-ffi-interface.h +++ b/pdns/dnsdistdist/dnsdist-lua-ffi-interface.h @@ -124,8 +124,6 @@ void dnsdist_ffi_dnsquestion_spoof_packet(dnsdist_ffi_dnsquestion_t* dq, const c /* decrease the returned TTL but _after_ inserting the original response into the packet cache */ void dnsdist_ffi_dnsquestion_set_max_returned_ttl(dnsdist_ffi_dnsquestion_t* dq, uint32_t max) __attribute__ ((visibility ("default"))); -/* add a record type to apply the TTL cap to (see above) */ -void dnsdist_ffi_dnsquestion_add_type_to_max_returned_ttl(dnsdist_ffi_dnsquestion_t* dr, uint16_t type) __attribute__ ((visibility ("default")));; typedef struct dnsdist_ffi_servers_list_t dnsdist_ffi_servers_list_t; typedef struct dnsdist_ffi_server_t dnsdist_ffi_server_t; @@ -148,8 +146,6 @@ void dnsdist_ffi_dnsresponse_set_max_ttl(dnsdist_ffi_dnsresponse_t* dr, uint32_t void dnsdist_ffi_dnsresponse_limit_ttl(dnsdist_ffi_dnsresponse_t* dr, uint32_t min, uint32_t max) __attribute__ ((visibility ("default"))); /* decrease the returned TTL but _after_ inserting the original response into the packet cache */ void dnsdist_ffi_dnsresponse_set_max_returned_ttl(dnsdist_ffi_dnsresponse_t* dr, uint32_t max) __attribute__ ((visibility ("default"))); -/* add a record type to apply the TTL cap to (see above) */ -void dnsdist_ffi_dnsresponse_add_type_to_max_returned_ttl(dnsdist_ffi_dnsresponse_t* dr, uint16_t type) __attribute__ ((visibility ("default")));; void dnsdist_ffi_dnsresponse_clear_records_type(dnsdist_ffi_dnsresponse_t* dr, uint16_t qtype) __attribute__ ((visibility ("default"))); typedef struct dnsdist_ffi_proxy_protocol_value { diff --git a/pdns/dnsdistdist/dnsdist-lua-ffi.cc b/pdns/dnsdistdist/dnsdist-lua-ffi.cc index 979e7f7627..a0f782710a 100644 --- a/pdns/dnsdistdist/dnsdist-lua-ffi.cc +++ b/pdns/dnsdistdist/dnsdist-lua-ffi.cc @@ -549,13 +549,6 @@ void dnsdist_ffi_dnsquestion_set_max_returned_ttl(dnsdist_ffi_dnsquestion_t* dq, } } -void dnsdist_ffi_dnsquestion_add_type_to_max_returned_ttl(dnsdist_ffi_dnsquestion_t* dq, uint16_t type) -{ - if (dq != nullptr && dq->dq != nullptr) { - dq->dq->ids.ttlCapTypes.insert(type); - } -} - size_t dnsdist_ffi_servers_list_get_count(const dnsdist_ffi_servers_list_t* list) { return list->ffiServers.size(); @@ -649,13 +642,6 @@ void dnsdist_ffi_dnsresponse_set_max_returned_ttl(dnsdist_ffi_dnsresponse_t* dr, } } -void dnsdist_ffi_dnsresponse_add_type_to_max_returned_ttl(dnsdist_ffi_dnsresponse_t* dr, uint16_t type) -{ - if (dr != nullptr && dr->dr != nullptr) { - dr->dr->ids.ttlCapTypes.insert(type); - } -} - void dnsdist_ffi_dnsresponse_clear_records_type(dnsdist_ffi_dnsresponse_t* dr, uint16_t qtype) { if (dr != nullptr && dr->dr != nullptr) {