]> git.ipfire.org Git - thirdparty/bind9.git/commit
Set result to SERVFAIL if upstream responded with FORMERR
authorWitold Kręcicki <wpk@isc.org>
Tue, 23 Oct 2018 11:45:30 +0000 (13:45 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 23 Oct 2018 11:50:27 +0000 (13:50 +0200)
commitb5c9a8caadafb4295aaf7040eee42ea0f1aeb8f6
treec99f37fdf64e69a961a730d416764abefb5beb57
parent9fd3c8a93938ad094aa22583bed38df0ee4a5d08
Set result to SERVFAIL if upstream responded with FORMERR

Commit ba912435427cf884fdc1ca26743eba6c00439106 causes the resolver to
respond to a client query with FORMERR when all upstream queries sent to
the servers authoritative for QNAME elicit FORMERR responses.  This
happens because resolver code returns DNS_R_FORMERR in such a case and
dns_result_torcode() acts as a pass-through for all arguments which are
already a valid RCODE.

The correct RCODE to set in the response returned to the client in the
case described above is SERVFAIL.  Make sure this happens by overriding
the RCODE in query_gotanswer(), on the grounds that any format errors in
the client query itself should be caught long before execution reaches
that point.  This change should not reduce query error logging accuracy
as the resolver code itself reports the exact reason for returning a
DNS_R_FORMERR result using log_formerr().
bin/tests/system/resolver/ans8/ans.pl
bin/tests/system/resolver/ns4/root.db
bin/tests/system/resolver/tests.sh
lib/ns/query.c