]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dns-query: export CNAME_MAX, so that we can use it in other files, too
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Mar 2021 16:47:45 +0000 (17:47 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 6 Mar 2021 12:33:50 +0000 (13:33 +0100)
Let's rename it a bit, to be more explanatory while exporting it.

(And let's bump the CNAME limit to 16 — 8 just sounded so little)

src/resolve/resolved-dns-query.c
src/resolve/resolved-dns-query.h

index 7554d1e82f41baf12f2768fa4e873dfd389be35d..aa9d65d4a827c4ff5c693035ce4961568e2d92d4 100644 (file)
@@ -10,7 +10,6 @@
 #include "resolved-etc-hosts.h"
 #include "string-util.h"
 
-#define CNAME_MAX 8
 #define QUERIES_MAX 2048
 #define AUXILIARY_QUERIES_MAX 64
 
@@ -977,7 +976,7 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname)
         assert(q);
 
         q->n_cname_redirects++;
-        if (q->n_cname_redirects > CNAME_MAX)
+        if (q->n_cname_redirects > CNAME_REDIRECT_MAX)
                 return -ELOOP;
 
         r = dns_question_cname_redirect(q->question_idna, cname, &nq_idna);
index ea296167b61e7a267d0aa3e7cc3a877e7c52d69e..5d12171b0a1290b0660287e3ce1127a0732feb8c 100644 (file)
@@ -145,3 +145,5 @@ static inline uint64_t dns_query_reply_flags_make(DnsQuery *q) {
                                       dns_query_fully_confidential(q)) |
                 (q->answer_query_flags & (SD_RESOLVED_FROM_MASK|SD_RESOLVED_SYNTHETIC));
 }
+
+#define CNAME_REDIRECT_MAX 16