]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix transfer of glue records in stub zones if master has minimal-responses set
authorDiego Fronza <diego@isc.org>
Thu, 10 Sep 2020 18:09:14 +0000 (15:09 -0300)
committerDiego Fronza <diego@isc.org>
Wed, 21 Oct 2020 15:03:42 +0000 (12:03 -0300)
commit1cee5579930807d504fc412ef462bcd287b30cfb
treea56cdeebd3636be5dc2956339800b2b03b5b88e0
parent803d12d430ac2fe7e006ff770129d5c7d5673a8f
Fix transfer of glue records in stub zones if master has minimal-responses set

Stub zones don't make use of AXFR/IXFR for the transfering of zone
data, instead, a single query is issued to the master asking for
their nameserver records (NS).

That works fine unless master is configured with 'minimal-responses'
set to yes, in which case glue records are not provided by master
in the answer with nameservers authoritative for the zone, leaving
stub zones with incomplete databases.

This commit fix this problem in a simple way, when the answer with
the authoritative nameservers is received from master (stub_callback),
for each nameserver listed (save_nsrrset), a A and AAAA records for
the name is verified in the additional section, and if not present
a query is created to resolve the corresponsing missing glue.

A struct 'stub_cb_args' was added to keep relevant information for
performing a query, like TSIG key, udp size, dscp value, etc, this
information is borrowed from, and created within function 'ns_query',
where the resolving of nameserver from master starts.

A new field was added to the struct 'dns_stub', an atomic integer,
namely pending_requests, which is used to keep how many queries are
created when resolving nameserver addresses that were missing in
the glue.

When the value of pending_requests is zero we know we can release
resources, adjust zone timers, dump to zone file, etc.
lib/dns/zone.c