1
0
mirror of https://passt.top/passt synced 2024-12-22 05:35:23 +00:00

dhcpv6: Turn some option headers pointers to const

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 <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Stefano Brivio 2024-11-07 18:08:46 +01:00
parent 5f5e814cfc
commit 1feb90fe62

View File

@ -423,11 +423,11 @@ search:
int dhcpv6(struct ctx *c, const struct pool *p, int dhcpv6(struct ctx *c, const struct pool *p,
const struct in6_addr *saddr, const struct in6_addr *daddr) const struct in6_addr *saddr, const struct in6_addr *daddr)
{ {
struct opt_hdr *ia, *bad_ia, *client_id; const struct opt_hdr *client_id, *server_id, *ia;
const struct opt_hdr *server_id;
const struct in6_addr *src; const struct in6_addr *src;
const struct msg_hdr *mh; const struct msg_hdr *mh;
const struct udphdr *uh; const struct udphdr *uh;
struct opt_hdr *bad_ia;
size_t mlen, n; size_t mlen, n;
uh = packet_get(p, 0, 0, sizeof(*uh), &mlen); uh = packet_get(p, 0, 0, sizeof(*uh), &mlen);