2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

Compress zone transfers properly

After change 5995, zone transfers were using a small
compression context that only had space for the first
few dozen names in each message. They now use a large
compression context with enough space for every name.
This commit is contained in:
Tony Finch
2022-11-29 20:23:31 +00:00
committed by Tony Finch
parent d38b49d696
commit a8f1d0c19c
4 changed files with 16 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
6032. [bug] After change 5995, zone transfers were using a small
compression context that only had space for the first
few dozen names in each message. They now use a large
compression context with enough space for every name.
[GL #3706]
6031. [bug] Move the "final reference detached" log message 6031. [bug] Move the "final reference detached" log message
from dns_zone unit to the DEBUG(1) log level. from dns_zone unit to the DEBUG(1) log level.
[GL #3707] [GL #3707]

View File

@@ -52,7 +52,6 @@ Bug Fixes
10 to 100 to accomodate for some browsers that send more that 10 10 to 100 to accomodate for some browsers that send more that 10
headers by default. :gl:`#3670` headers by default. :gl:`#3670`
- Copy TLS identifier when setting up primaries for catalog member - Copy TLS identifier when setting up primaries for catalog member
zones. :gl:`#3638` zones. :gl:`#3638`
@@ -64,6 +63,10 @@ Bug Fixes
:iscman:`named-checkzone` tool from superfluously logging this message :iscman:`named-checkzone` tool from superfluously logging this message
in non-debug mode. :gl:`#3707` in non-debug mode. :gl:`#3707`
- The new name compression code in BIND 9.19.7 was not compressing
names in zone transfers that should have been compressed, so zone
transfers were larger than before. :gl:`#3706`
Known Issues Known Issues
~~~~~~~~~~~~ ~~~~~~~~~~~~

View File

@@ -58,9 +58,10 @@ ISC_LANG_BEGINDECLS
* few dozen names in the hash set. (We can't actually use every slot because * few dozen names in the hash set. (We can't actually use every slot because
* space is reserved for performance reasons.) For large messages, the number * space is reserved for performance reasons.) For large messages, the number
* of names is limited by the minimum size of an RR (owner, type, class, ttl, * of names is limited by the minimum size of an RR (owner, type, class, ttl,
* length) which is 16 bytes when the owner has a new 3-character label * length) which is 12 bytes - call it 16 bytes to make space for a new label.
* before the compressed zone name. Divide the maximum compression offset * Divide the maximum compression offset 0x4000 by 16 and you get 0x400 == 1024.
* 0x3FFF by 16 and you get roughly 1024. * In practice, the root zone (for example) uses less than 200 distinct names
* per message.
*/ */
enum { enum {
DNS_COMPRESS_SMALLBITS = 6, DNS_COMPRESS_SMALLBITS = 6,

View File

@@ -1527,7 +1527,8 @@ sendstream(xfrout_ctx_t *xfr) {
if (is_tcp) { if (is_tcp) {
isc_region_t used; isc_region_t used;
dns_compress_init(&cctx, xfr->mctx, DNS_COMPRESS_CASE); dns_compress_init(&cctx, xfr->mctx,
DNS_COMPRESS_CASE | DNS_COMPRESS_LARGE);
cleanup_cctx = true; cleanup_cctx = true;
CHECK(dns_message_renderbegin(msg, &cctx, &xfr->txbuf)); CHECK(dns_message_renderbegin(msg, &cctx, &xfr->txbuf));
CHECK(dns_message_rendersection(msg, DNS_SECTION_QUESTION, 0)); CHECK(dns_message_rendersection(msg, DNS_SECTION_QUESTION, 0));