summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-cache.c
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-06-24 08:01:49 +0200
committerGitHub <noreply@github.com>2016-06-24 08:01:49 +0200
commit54522e941df6a379d65ef1822af4215654fe1513 (patch)
tree47c4b4a39ca1dfea520e484b62502ed5528e3d34 /src/resolve/resolved-dns-cache.c
parent39c38ce17c3a15f7b709536a6d7f1f7e093ac450 (diff)
parentb3c6b00a93cca0e9108cef0b63e11787c1e10fc3 (diff)
Merge pull request #3594 from poettering/resolved-servfail
resolved fixes for handling SERVFAIL errors from servers
Diffstat (limited to 'src/resolve/resolved-dns-cache.c')
-rw-r--r--src/resolve/resolved-dns-cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
index 0bb5a95188..87f7c21d03 100644
--- a/src/resolve/resolved-dns-cache.c
+++ b/src/resolve/resolved-dns-cache.c
@@ -624,6 +624,12 @@ int dns_cache_put(
dns_cache_remove_previous(c, key, answer);
+ /* We only care for positive replies and NXDOMAINs, on all
+ * other replies we will simply flush the respective entries,
+ * and that's it */
+ if (!IN_SET(rcode, DNS_RCODE_SUCCESS, DNS_RCODE_NXDOMAIN))
+ return 0;
+
if (dns_answer_size(answer) <= 0) {
char key_str[DNS_RESOURCE_KEY_STRING_MAX];
@@ -632,12 +638,6 @@ int dns_cache_put(
return 0;
}
- /* We only care for positive replies and NXDOMAINs, on all
- * other replies we will simply flush the respective entries,
- * and that's it */
- if (!IN_SET(rcode, DNS_RCODE_SUCCESS, DNS_RCODE_NXDOMAIN))
- return 0;
-
cache_keys = dns_answer_size(answer);
if (key)
cache_keys++;