]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix: dev: Clean up dns_rdataslab module
authorEvan Hunt <each@isc.org>
Wed, 19 Feb 2025 23:43:41 +0000 (23:43 +0000)
committerEvan Hunt <each@isc.org>
Wed, 19 Feb 2025 23:43:41 +0000 (23:43 +0000)
Rdata slabs used in the QP databases are usually prepended with a slab header, but are sometimes "raw", containing only the rdata and no header. Previously, to allow for them to be used both ways, functions that operated on them took a `reservelen` argument, which would be set to either the header length or to zero, and skipped over that many bytes at the beginning of the buffer. Most such functions were never used on the raw form. To make the code clearer, each of these functions now operates on full slabs with headers, and an alternate "raw" version of the function has been added in cases where that was needed.

In addition, the `dns_rdataslab_merge()` and `_subtract()` functions have been rewritten for clarity and efficiency, and a minor bug has been fixed in `dns_rdataslab_equal()` and `_equalx()`, which could cause an incorrect result if both slabs being compared had zero length.

Merge branch 'each-refactor-rdataslab' into 'main'

See merge request isc-projects/bind9!10084


Trivial merge