From: Ondřej Surý Date: Wed, 29 Jul 2026 14:03:48 +0000 (+0200) Subject: Remove the ownercase bitmap from dns_slabheader_t X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4802dd57f02247e69c041584008ca470ad1d05a9;p=thirdparty%2Fbind9.git Remove the ownercase bitmap from dns_slabheader_t Since the database ownercase became modifiable only through dns_db_addrdataset(), nothing ever sets the CASESET attribute on a slabheader, so the upper[] case bitmap was never written and the slab getownercase method could never restore anything. Remove both, shrinking every cache slabheader by 32 bytes. --- diff --git a/lib/dns/include/dns/rdataslab.h b/lib/dns/include/dns/rdataslab.h index 54331151abc..5dae1d93802 100644 --- a/lib/dns/include/dns/rdataslab.h +++ b/lib/dns/include/dns/rdataslab.h @@ -95,13 +95,6 @@ struct dns_slabheader { */ dns_dbnode_t *node; - /*% - * Case vector. If the bit is set then the corresponding - * character in the owner name needs to be AND'd with 0x20, - * rendering that character upper case. - */ - unsigned char upper[32]; - /* Used for stale refresh */ _Atomic(isc_stdtime_t) last_refresh_fail_ts; diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c index 011f5d74aa0..e87be113b22 100644 --- a/lib/dns/rdataslab.c +++ b/lib/dns/rdataslab.c @@ -72,8 +72,6 @@ static void rdataset_expire(dns_rdataset_t *rdataset DNS__DB_FLARG); static void rdataset_clearprefetch(dns_rdataset_t *rdataset); -static void -rdataset_getownercase(const dns_rdataset_t *rdataset, dns_name_t *name); static dns_slabheader_t * rdataset_getheader(const dns_rdataset_t *rdataset); @@ -88,7 +86,6 @@ dns_rdatasetmethods_t dns_rdataslab_rdatasetmethods = { .settrust = rdataset_settrust, .expire = rdataset_expire, .clearprefetch = rdataset_clearprefetch, - .getownercase = rdataset_getownercase, }; static void @@ -794,34 +791,6 @@ rdataset_clearprefetch(dns_rdataset_t *rdataset) { DNS_SLABHEADER_CLRATTR(header, DNS_SLABHEADERATTR_PREFETCH); } -static void -rdataset_getownercase(const dns_rdataset_t *rdataset, dns_name_t *name) { - dns_slabheader_t *header = rdataset_getheader(rdataset); - uint8_t mask = (1 << 7); - uint8_t bits = 0; - - if (!CASESET(header)) { - return; - } - - if (CASEFULLYLOWER(header)) { - isc_ascii_lowercopy(name->ndata, name->ndata, name->length); - return; - } - - uint8_t *nd = name->ndata; - for (size_t i = 0; i < name->length; i++) { - if (mask == (1 << 7)) { - bits = header->upper[i / 8]; - mask = 1; - } else { - mask <<= 1; - } - nd[i] = (bits & mask) ? isc_ascii_toupper(nd[i]) - : isc_ascii_tolower(nd[i]); - } -} - static dns_slabheader_t * rdataset_getheader(const dns_rdataset_t *rdataset) { uint8_t *rawbuf = rdataset->slab.raw;