From: Lennart Poettering Date: Fri, 5 Mar 2021 16:47:45 +0000 (+0100) Subject: dns-query: export CNAME_MAX, so that we can use it in other files, too X-Git-Tag: v248-rc3~38^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0ae456a554d0fce250f9a009c561b97f20c41f8;p=thirdparty%2Fsystemd.git dns-query: export CNAME_MAX, so that we can use it in other files, too 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) --- diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index 7554d1e82f4..aa9d65d4a82 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -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); diff --git a/src/resolve/resolved-dns-query.h b/src/resolve/resolved-dns-query.h index ea296167b61..5d12171b0a1 100644 --- a/src/resolve/resolved-dns-query.h +++ b/src/resolve/resolved-dns-query.h @@ -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