From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=JUIE350s; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 7D57D5A061F for ; Wed, 06 Nov 2024 07:54:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730876064; bh=SDLsXgdDZFu4TbjUvFirTLqDC7bHtFnOhd8/ccN0E4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JUIE350s1vASijmgJMWwTVcZest3ZUjyFM1AiZoeAjpq49ZK1nxuD1dHdxu380kib Uv9CUYLfALUyh0v8yDd1I1P+KDMGEzFDD8BlkHf++AlZmaTI1UuLJUpQLW/c9lAAzm v3MrncMBvsq801lInslEpo7knP1+U3DVoADwZt9SlTrOR+W/GUyT8K4Q6q4ZwIGmX5 69sPJ02nO0qD4uyJGYHPLmQd6DhB2PECgP1Qrn+nub2BEusJe/mxgFuFdefTlZ3P3+ vcdovVatTvvpsIdBhRmasYE3ELCpe4H8g2llKbLfzjF0d1OYCmW4K+t9bwEhJ6rqzw 7HVoFJMdcgzUA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Xjwt80xtNz4xG0; Wed, 6 Nov 2024 17:54:24 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 5/8] ndp: Use const pointer for ndp_ns packet Date: Wed, 6 Nov 2024 17:54:18 +1100 Message-ID: <20241106065421.2568179-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106065421.2568179-1-david@gibson.dropbear.id.au> References: <20241106065421.2568179-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: GKKXCIUD3DTK3DEVS2MORBMBASFQI2WA X-Message-ID-Hash: GKKXCIUD3DTK3DEVS2MORBMBASFQI2WA X-MailFrom: dgibson@gandalf.ozlabs.org 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: We don't modify this structure at all. For some reason cppcheck doesn't catch this with our current options, but did when I was experimenting with some different options. Signed-off-by: David Gibson --- ndp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndp.c b/ndp.c index a1ee834..faae408 100644 --- a/ndp.c +++ b/ndp.c @@ -234,8 +234,8 @@ int ndp(struct ctx *c, const struct icmp6hdr *ih, const struct in6_addr *saddr, return 1; if (ih->icmp6_type == NS) { - struct ndp_ns *ns = packet_get(p, 0, 0, sizeof(struct ndp_ns), - NULL); + const struct ndp_ns *ns = + packet_get(p, 0, 0, sizeof(struct ndp_ns), NULL); if (!ns) return -1; -- 2.47.0