From f8860bb099abbc3d999a53c0801cf52d15dcb720 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 2 Sep 2025 09:52:31 +0200 Subject: ndp: Convert to iov_tail Use packet_data() and extract headers using IOV_REMOVE_HEADER() rather than packet_get(). Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Signed-off-by: Stefano Brivio --- ndp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3