mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- More braces and formatting for Fix for EDNS EDE size calculation to
avoid future bugs.
This commit is contained in:
parent
990b12bc8e
commit
8aec671860
2 changed files with 8 additions and 6 deletions
|
|
@ -3,6 +3,8 @@
|
||||||
when there isn't enough space.
|
when there isn't enough space.
|
||||||
- For #911: Try to trim EXTRA-TEXT (and LDNS_EDE_OTHER options
|
- For #911: Try to trim EXTRA-TEXT (and LDNS_EDE_OTHER options
|
||||||
altogether) before giving up on attaching EDE options.
|
altogether) before giving up on attaching EDE options.
|
||||||
|
- More braces and formatting for Fix for EDNS EDE size calculation to
|
||||||
|
avoid future bugs.
|
||||||
|
|
||||||
1 August 2023: Wouter
|
1 August 2023: Wouter
|
||||||
- Fix for EDNS EDE size calculation.
|
- Fix for EDNS EDE size calculation.
|
||||||
|
|
|
||||||
|
|
@ -835,23 +835,23 @@ calc_ede_option_size(struct edns_data* edns, uint16_t* txt_size)
|
||||||
for(opt = edns->opt_list_inplace_cb_out; opt; opt = opt->next) {
|
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;
|
rdatalen += 4 + opt->opt_len;
|
||||||
if(opt->opt_len > 2)
|
if(opt->opt_len > 2) *txt_size += opt->opt_len - 2;
|
||||||
*txt_size += opt->opt_len - 2;
|
|
||||||
if(opt->opt_len >= 2 && sldns_read_uint16(
|
if(opt->opt_len >= 2 && sldns_read_uint16(
|
||||||
opt->opt_data) == LDNS_EDE_OTHER)
|
opt->opt_data) == LDNS_EDE_OTHER) {
|
||||||
*txt_size += 4 + 2;
|
*txt_size += 4 + 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for(opt = edns->opt_list_out; opt; opt = opt->next) {
|
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;
|
rdatalen += 4 + opt->opt_len;
|
||||||
if(opt->opt_len > 2)
|
if(opt->opt_len > 2) *txt_size += opt->opt_len - 2;
|
||||||
*txt_size += opt->opt_len - 2;
|
|
||||||
if(opt->opt_len >= 2 && sldns_read_uint16(
|
if(opt->opt_len >= 2 && sldns_read_uint16(
|
||||||
opt->opt_data) == LDNS_EDE_OTHER)
|
opt->opt_data) == LDNS_EDE_OTHER) {
|
||||||
*txt_size += 4 + 2;
|
*txt_size += 4 + 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return rdatalen;
|
return rdatalen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue