resolved: retry on SERVFAIL before downgrading feature level
authorSteven Siloti <ssiloti@gmail.com>
Sun, 11 Jul 2021 18:05:26 +0000 (11:05 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 24 Aug 2021 10:55:18 +0000 (12:55 +0200)
commit8280bec34df8e35592f4a4a549127471a9199231
tree5c42b377c4056cfd01f2049fe9037bef73005776
parent872d101c2308e07c523fd6ca84bd774447f05b7e
resolved: retry on SERVFAIL before downgrading feature level

The SERVFAIL RCODE can be generated for many reasons which may not be related
to lack of feature support. For example, the Stubby resolver generates
SERVFAIL when a request times out. Such transient failures can cause
unnecessary downgrades to both the transaction and the server's feature level.
The consequences of this are especially severe if the server is in DNSSEC
strict mode. In this case repeated downgrades eventually cause the server to
stop resolving entirely with the error "incompatible-server".

To avoid unnecessary downgrades the request should be retried once with the
current level before the transaction's feature level is downgraded.

(cherry picked from commit 8a33aa199dc1cea14494469ac9d7d08dc6721df1)
src/resolve/resolved-dns-server.c
src/resolve/resolved-dns-transaction.c