summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-server.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-07-16 14:39:55 +0200
committerTom Gundersen <teg@jklm.no>2015-11-27 01:35:33 +0100
commit4e0b8b17a7465653f4e7b819dad5f8e30d64c0c4 (patch)
treecfa7d0e00310ceaf42533f1bddc007b7c779a76c /src/resolve/resolved-dns-server.c
parentbe808ea083fa07271116b4519c3c27fd20c5f077 (diff)
resolved: degrade the feature level on explicit failure
Previously, we would only degrade on packet loss, but when adding EDNS0 support, we also have to handle the case where the server replies with an explicit error.
Diffstat (limited to 'src/resolve/resolved-dns-server.c')
-rw-r--r--src/resolve/resolved-dns-server.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c
index 5fc7c3187f..c5396a03c8 100644
--- a/src/resolve/resolved-dns-server.c
+++ b/src/resolve/resolved-dns-server.c
@@ -253,6 +253,16 @@ void dns_server_packet_lost(DnsServer *s, DnsServerFeatureLevel features, usec_t
s->resend_timeout = MIN(s->resend_timeout * 2, DNS_TIMEOUT_MAX_USEC);
}
+void dns_server_packet_failed(DnsServer *s, DnsServerFeatureLevel features) {
+ assert(s);
+ assert(s->manager);
+
+ if (s->possible_features != features)
+ return;
+
+ s->n_failed_attempts = (unsigned) -1;
+}
+
static bool dns_server_grace_period_expired(DnsServer *s) {
usec_t ts;