From 990b12bc8ed29b330a0e1d0ad293e26cfad4cf2a Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 1 Aug 2023 15:08:50 +0200 Subject: [PATCH] - Fix for EDNS EDE size calculation. --- doc/Changelog | 3 +++ util/data/msgencode.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index d274a5c1c..b3ac846ce 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/util/data/msgencode.c b/util/data/msgencode.c index 19a5a6ec0..f42dd6b2d 100644 --- a/util/data/msgencode.c +++ b/util/data/msgencode.c @@ -833,22 +833,24 @@ 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; if(opt->opt_len >= 2 && sldns_read_uint16( 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; if(opt->opt_len >= 2 && sldns_read_uint16( opt->opt_data) == LDNS_EDE_OTHER) *txt_size += 4 + 2; + } } return rdatalen; }