- For #911: Try to trim EXTRA-TEXT (and LDNS_EDE_OTHER options

altogether) before giving up on attaching EDE options.
This commit is contained in:
George Thessalonikefs
2023-08-01 09:55:28 +02:00
parent dcd0191d7e
commit 08e11284fb
3 changed files with 312 additions and 8 deletions
+13
View File
@@ -116,6 +116,19 @@ uint16_t calc_edns_field_size(struct edns_data* edns);
*/
uint16_t calc_edns_option_size(struct edns_data* edns, uint16_t code);
/**
* Calculate the size of the EDE option(s) in packet. Also calculate seperately
* the size of the EXTRA-TEXT field(s) in case we can trim them to fit.
* In this case include any LDNS_EDE_OTHER options in their entirety since they
* are useless without extra text.
* @param edns: edns data or NULL.
* @param txt_size: the size of the EXTRA-TEXT field(s); this includes
* LDNS_EDE_OTHER in their entirety since they are useless without
* extra text.
* @return octets the option will take up.
*/
uint16_t calc_ede_option_size(struct edns_data* edns, uint16_t* txt_size);
/**
* Attach EDNS record to buffer. Buffer has complete packet. There must
* be enough room left for the EDNS record.