From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 0C1015A061D; Thu, 07 Nov 2024 19:43:31 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 2/6] dhcpv6: Turn some option headers pointers to const Date: Thu, 7 Nov 2024 19:43:27 +0100 Message-ID: <20241107184331.3164784-3-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241107184331.3164784-1-sbrivio@redhat.com> References: <20241107184331.3164784-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: LMBAYI2CC5O7THCW2G7A6KP7EHPVKK3T X-Message-ID-Hash: LMBAYI2CC5O7THCW2G7A6KP7EHPVKK3T X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: cppcheck 2.14.2 on Alpine reports: dhcpv6.c:431:32: style: Variable 'client_id' can be declared as pointer to const [constVariablePointer] struct opt_hdr *ia, *bad_ia, *client_id; ^ It's not only 'client_id': we can declare 'ia' as const pointer too. Signed-off-by: Stefano Brivio --- dhcpv6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhcpv6.c b/dhcpv6.c index f2e7307..0523bba 100644 --- a/dhcpv6.c +++ b/dhcpv6.c @@ -423,11 +423,11 @@ search: int dhcpv6(struct ctx *c, const struct pool *p, const struct in6_addr *saddr, const struct in6_addr *daddr) { - struct opt_hdr *ia, *bad_ia, *client_id; - const struct opt_hdr *server_id; + const struct opt_hdr *client_id, *server_id, *ia; const struct in6_addr *src; const struct msg_hdr *mh; const struct udphdr *uh; + struct opt_hdr *bad_ia; size_t mlen, n; uh = packet_get(p, 0, 0, sizeof(*uh), &mlen); -- 2.43.0