]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Remove ttlCapTypes from the internal state 12384/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 2 Dec 2022 14:29:45 +0000 (15:29 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 11 Jan 2023 13:42:29 +0000 (14:42 +0100)
pdns/dnsdist-idstate.hh
pdns/dnsdist.cc
pdns/dnsdistdist/dnsdist-lua-ffi-interface.h
pdns/dnsdistdist/dnsdist-lua-ffi.cc

index e90bf953c2278809dcb9ab247520bb47e34ef10f..5b42f986f561f764767b9835298904f816ec441a 100644 (file)
@@ -117,7 +117,6 @@ struct InternalQueryState
   InternalQueryState& operator=(const InternalQueryState& orig) = delete;
 
   boost::optional<Netmask> subnet{boost::none}; // 40
-  std::unordered_set<QType> ttlCapTypes;
   ComboAddress origRemote; // 28
   ComboAddress origDest; // 28
   ComboAddress hopRemote;
index 2faeede4e1bb073b5a12b36570b834ea3a20932e..2956826488f14248567ca6134015f453169e143d 100644 (file)
@@ -554,7 +554,7 @@ bool processResponse(PacketBuffer& response, const std::vector<DNSDistResponseRu
 
   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);
   }
 
@@ -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);
   }
 
index ee61517028744c7d843d84969c5666e90117c9e3..3a509058a2a9f4038deb0e50dd6cdd39fa737f6f 100644 (file)
@@ -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 {
index 979e7f7627367b83be2f487ff0203aa122c28aa0..a0f782710a069a151265976c91005b5f5d782a8f 100644 (file)
@@ -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) {