]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: make counter for n_auxiliary_queries smaller
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 14 May 2021 09:12:12 +0000 (11:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 14 May 2021 14:26:26 +0000 (16:26 +0200)
It can never go above 64, so let's use a narrower type.

Order will be adjusted later to remove holes.

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

index 5517db149d0827465686c1f8d09b5b4e596df751..beb20592bd1016648041c887dd205a1f52b1d189 100644 (file)
@@ -13,6 +13,8 @@
 #define QUERIES_MAX 2048
 #define AUXILIARY_QUERIES_MAX 64
 
+assert_cc(AUXILIARY_QUERIES_MAX < UINT8_MAX);
+
 static int dns_query_candidate_new(DnsQueryCandidate **ret, DnsQuery *q, DnsScope *s) {
         DnsQueryCandidate *c;
 
index fa584fe3de9d884853d3564042476bc1614246fb..be9b5fa548876aaf4f148b22acd4c6286b74a9b0 100644 (file)
@@ -38,7 +38,7 @@ struct DnsQuery {
          * TXT+SRV query. */
         DnsQuery *auxiliary_for;
         LIST_HEAD(DnsQuery, auxiliary_queries);
-        unsigned n_auxiliary_queries;
+        uint8_t n_auxiliary_queries;
         int auxiliary_result;
 
         /* The question, formatted in IDNA for use on classic DNS, and as UTF8 for use in LLMNR or mDNS. Note