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=IUkcxBvb; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id E72F15A061B for ; Fri, 08 Nov 2024 03:23:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1731032623; bh=Zt9n0zDlEbrUKiV14JPDA32IewV7gJSGnZwo0765vnY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IUkcxBvb2/gfE4sDQmkt/xnQA8XiAyPaqz87g39tiM7xyTidAUosx6/kZBTEC60ww rbsROFUhQQQTLw6PZgMPWtTpVtn15THiNTfhIxBNPRCdAxlZKyK4g33eDs2OureL71 ZkjwTMhkEJYkQyBxdj0EJmSvxWkYgQ/pYdl74wbdJk2Tt1lrqm8Kdlxbpnb+OofwWS wZnxuv6w5s8x0rS8OPqAbs/3Cptjid2Vjd5TYEd+/HA5clR4VdoxExBtNgib1nb5A7 lbZ67sA0B/gs6CfWNc6HYvH3xj7zhRWZwxEXxPyP24S/9TQpC5qv/aob8pUtFIwVDp l6Tgcj2i56uCg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Xl2mv25xGz4x6n; Fri, 8 Nov 2024 13:23:43 +1100 (AEDT) Date: Fri, 8 Nov 2024 11:27:46 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 2/6] dhcpv6: Turn some option headers pointers to const Message-ID: References: <20241107184331.3164784-1-sbrivio@redhat.com> <20241107184331.3164784-3-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tSbp53KTPCn3F6S/" Content-Disposition: inline In-Reply-To: <20241107184331.3164784-3-sbrivio@redhat.com> Message-ID-Hash: BRUQSWK25DI3PWU3J6SFKHTFFQBFPVKJ X-Message-ID-Hash: BRUQSWK25DI3PWU3J6SFKHTFFQBFPVKJ 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: passt-dev@passt.top 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: --tSbp53KTPCn3F6S/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 07, 2024 at 07:43:27PM +0100, Stefano Brivio wrote: > cppcheck 2.14.2 on Alpine reports: >=20 > dhcpv6.c:431:32: style: Variable 'client_id' can be declared as pointer t= o const [constVariablePointer] > struct opt_hdr *ia, *bad_ia, *client_id; > ^ >=20 > It's not only 'client_id': we can declare 'ia' as const pointer too. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > dhcpv6.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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; > =20 > uh =3D packet_get(p, 0, 0, sizeof(*uh), &mlen); --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --tSbp53KTPCn3F6S/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmctWwEACgkQzQJF27ox 2GfmEw//aqBwiJDCLtgzk59ZoLXOwjRZeMhutnQzduDk02Fhzuk6UQsHkKuYdMG6 hC+YCnK0fHkmatlFqqmXQUuvm2456W6QoZ+VLmksFTycfL/1rZTQzKM7Y9IJh+Yl wAlTeTDPoHEMLn/z+ToblKyvp1cozSeYM2ZilgXIzMf7m0W422qHXr5r1Q1k2o5R /bdXhGp4JwgYLT3TV4L7lL8u3Z4psUDjcQMEphw5FFleFhrD8bXxJmDkVHwFdgYp 4lAzOISM3xV/i5NIms0xWHn+9SoH4hfOf9sU9UNbjKOCgmKpPAlCJlqNseaJGqde PXPIKLmdXxHMDj+J7YMp8ldux9yTP/fX86cxjMmYxwR62Nw8MElLhjn4P1PuiUaV d3ISQtpC5fNc3/5nHlTJCK3alSnnCd2ztqZADJH1PlhFTsVOXDwfVhWos7f715EA 9cHV9Kr4DHWn3P+QA97fcOtfsPRGYlMgkHQhXAGRz3gIVjmnvuNZ0PjuqqTxHyQM kiHqzSp89is0iMGS8Hgg6ms9EPcfRixXVuiy0olw8+uF6B/4KNQ3pNo3JhNusow4 dqKseHeaVU8ly4wgdxogQS1w+uc9Ya7jJyc5cOAijyurgyfK9tYj254C2/J8qb+F MdqCn+Px9s7j875kN06kcWcD3mOh3heWZpaKZaJLINRr34IqsXM= =HP6G -----END PGP SIGNATURE----- --tSbp53KTPCn3F6S/--