dns-query: export CNAME_MAX, so that we can use it in other files, too v247.7
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Mar 2021 16:47:45 +0000 (17:47 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 15 May 2021 19:19:27 +0000 (21:19 +0200)
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)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1949670.

(cherry picked from commit e0ae456a554d0fce250f9a009c561b97f20c41f8)

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

index 65a0a73cb89db99e1e0a385287f04026d55988ca..fb945543583988a57cecfab0787139dfcfab25fa 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
 
@@ -912,7 +911,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 133076dbf071199b91c74023fa71aaa4afb397de..c6b918a5f77e552e66b516917974f69a0e69d1cf 100644 (file)
@@ -128,3 +128,5 @@ const char *dns_query_string(DnsQuery *q);
 DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQuery*, dns_query_free);
 
 bool dns_query_fully_authenticated(DnsQuery *q);
+
+#define CNAME_REDIRECT_MAX 16