From: Zbigniew Jędrzejewski-Szmek Date: Fri, 14 May 2021 09:12:12 +0000 (+0200) Subject: resolved: make counter for n_auxiliary_queries smaller X-Git-Tag: v249-rc1~203^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1004d0aba336d9ce2e7d1e12780530894ae5c14;p=thirdparty%2Fsystemd.git resolved: make counter for n_auxiliary_queries smaller It can never go above 64, so let's use a narrower type. Order will be adjusted later to remove holes. --- diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index 5517db149d0..beb20592bd1 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -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; diff --git a/src/resolve/resolved-dns-query.h b/src/resolve/resolved-dns-query.h index fa584fe3de9..be9b5fa5488 100644 --- a/src/resolve/resolved-dns-query.h +++ b/src/resolve/resolved-dns-query.h @@ -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