]> git.ipfire.org Git - thirdparty/bind9.git/commit
Remove INSIST on NS_QUERYATTR_ANSWERED
authorMatthijs Mekking <matthijs@isc.org>
Fri, 26 Mar 2021 10:58:12 +0000 (11:58 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 2 Apr 2021 07:15:07 +0000 (09:15 +0200)
commit3d5429f61f264e5f5a7be036a1046dc5b83193e7
tree88e056254faccc0b55fa99f0da58a3290fbc3c9c
parent48b0dc159b9519f8c2ee1d2d529dad40cf2947eb
Remove INSIST on NS_QUERYATTR_ANSWERED

The NS_QUERYATTR_ANSWERED attribute is to prevent sending a response
twice. Without the attribute, this may happen if a staleonly lookup
found a useful answer and sends a response to the client, and later
recursion ends and also tries to send a response.

The attribute was also used to mask adding a duplicate RRset. This is
considered harmful. When we created a response to the client with a
stale only lookup (regardless if we actually have send the response),
we should clear the rdatasets that were added during that lookup.

Mark such rdatasets with the a new attribute,
DNS_RDATASETATTR_STALE_ADDED. Set a query attribute
NS_QUERYATTR_STALEOK if we may have added rdatasets during a stale
only lookup. Before creating a response on a normal lookup, check if
we can expect rdatasets to have been added during a staleonly lookup.
If so, clear the rdatasets from the message with the attribute
DNS_RDATASETATTR_STALE_ADDED set.
lib/dns/include/dns/rdataset.h
lib/ns/query.c