- Fix for EDNS EDE size calculation.

This commit is contained in:
W.C.A. Wijngaards 2023-08-01 15:08:50 +02:00
parent 11f12bc981
commit 990b12bc8e
2 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,9 @@
- For #911: Try to trim EXTRA-TEXT (and LDNS_EDE_OTHER options
altogether) before giving up on attaching EDE options.
1 August 2023: Wouter
- Fix for EDNS EDE size calculation.
31 July 2023: George
- Merge #790 from Tom Carpay: Add support for EDE caching in cachedb
and subnetcache.

View file

@ -833,7 +833,7 @@ calc_ede_option_size(struct edns_data* edns, uint16_t* txt_size)
if(!edns || !edns->edns_present)
return 0;
for(opt = edns->opt_list_inplace_cb_out; opt; opt = opt->next) {
if(opt->opt_code == LDNS_EDNS_EDE)
if(opt->opt_code == LDNS_EDNS_EDE) {
rdatalen += 4 + opt->opt_len;
if(opt->opt_len > 2)
*txt_size += opt->opt_len - 2;
@ -841,8 +841,9 @@ calc_ede_option_size(struct edns_data* edns, uint16_t* txt_size)
opt->opt_data) == LDNS_EDE_OTHER)
*txt_size += 4 + 2;
}
}
for(opt = edns->opt_list_out; opt; opt = opt->next) {
if(opt->opt_code == LDNS_EDNS_EDE)
if(opt->opt_code == LDNS_EDNS_EDE) {
rdatalen += 4 + opt->opt_len;
if(opt->opt_len > 2)
*txt_size += opt->opt_len - 2;
@ -850,6 +851,7 @@ calc_ede_option_size(struct edns_data* edns, uint16_t* txt_size)
opt->opt_data) == LDNS_EDE_OTHER)
*txt_size += 4 + 2;
}
}
return rdatalen;
}