aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-11-07 18:08:46 +0100
committerStefano Brivio <sbrivio@redhat.com>2024-11-08 08:24:41 +0100
commit1feb90fe627959e4903e01ba83249fa33c4d472d (patch)
tree030555e3064e62f75f1eaed4fac3f0a12fc86f6d
parent5f5e814cfc27c14cd7f116c8fb59e17d5671cafe (diff)
downloadpasst-1feb90fe627959e4903e01ba83249fa33c4d472d.tar
passt-1feb90fe627959e4903e01ba83249fa33c4d472d.tar.gz
passt-1feb90fe627959e4903e01ba83249fa33c4d472d.tar.bz2
passt-1feb90fe627959e4903e01ba83249fa33c4d472d.tar.lz
passt-1feb90fe627959e4903e01ba83249fa33c4d472d.tar.xz
passt-1feb90fe627959e4903e01ba83249fa33c4d472d.tar.zst
passt-1feb90fe627959e4903e01ba83249fa33c4d472d.zip
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>
-rw-r--r--dhcpv6.c4
1 files 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);