aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-11-06 17:54:18 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-11-07 12:47:19 +0100
commitd8e05a3fe0f2db444c51342888b37ed351b66f63 (patch)
tree0e592be5d49f478c6920f65d72b64cf665a6557f
parent0d7b8201ed5788416d1b36fc3a554b61ad10c201 (diff)
downloadpasst-d8e05a3fe0f2db444c51342888b37ed351b66f63.tar
passt-d8e05a3fe0f2db444c51342888b37ed351b66f63.tar.gz
passt-d8e05a3fe0f2db444c51342888b37ed351b66f63.tar.bz2
passt-d8e05a3fe0f2db444c51342888b37ed351b66f63.tar.lz
passt-d8e05a3fe0f2db444c51342888b37ed351b66f63.tar.xz
passt-d8e05a3fe0f2db444c51342888b37ed351b66f63.tar.zst
passt-d8e05a3fe0f2db444c51342888b37ed351b66f63.zip
ndp: Use const pointer for ndp_ns packet
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--ndp.c4
1 files 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;