aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2025-09-02 09:52:31 +0200
committerStefano Brivio <sbrivio@redhat.com>2025-09-03 20:42:28 +0200
commitf8860bb099abbc3d999a53c0801cf52d15dcb720 (patch)
tree09e62893c928480b2d14bdee1cb157e5ec332e9b
parent1fc944ce18699e87fa9924762d1d93814b659f73 (diff)
downloadpasst-f8860bb099abbc3d999a53c0801cf52d15dcb720.tar
passt-f8860bb099abbc3d999a53c0801cf52d15dcb720.tar.gz
passt-f8860bb099abbc3d999a53c0801cf52d15dcb720.tar.bz2
passt-f8860bb099abbc3d999a53c0801cf52d15dcb720.tar.lz
passt-f8860bb099abbc3d999a53c0801cf52d15dcb720.tar.xz
passt-f8860bb099abbc3d999a53c0801cf52d15dcb720.tar.zst
passt-f8860bb099abbc3d999a53c0801cf52d15dcb720.zip
ndp: Convert to iov_tail
Use packet_data() and extract headers using IOV_REMOVE_HEADER() rather than packet_get(). Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--ndp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ndp.c b/ndp.c
index 3e15494..5de4e50 100644
--- a/ndp.c
+++ b/ndp.c
@@ -350,9 +350,14 @@ int ndp(const struct ctx *c, const struct icmp6hdr *ih,
return 1;
if (ih->icmp6_type == NS) {
+ struct ndp_ns ns_storage;
const struct ndp_ns *ns;
+ struct iov_tail data;
- ns = packet_get(p, 0, 0, sizeof(struct ndp_ns), NULL);
+ if (!packet_data(p, 0, &data))
+ return -1;
+
+ ns = IOV_REMOVE_HEADER(&data, ns_storage);
if (!ns)
return -1;