]> 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:11:31 +0000 (12:11 -0300)
commit7a3dbbc39539f8120fee82de251bfc04e94c70ec
tree6ba6ea002616782e4c62074f7ea5094e77fd8f04
parentaff8cb334d594769855fef0ae8d22771e4111b98
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