On Wed, Apr 02, 2025 at 07:23:32PM +0200, Laurent Vivier wrote:
Use packet_base() and extract headers using IOV_REMOVE_HEADER() rather than packet_get().
Signed-off-by: Laurent Vivier
Reviewed-by: David Gibson
--- ndp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ndp.c b/ndp.c index ded2081ddd1d..64e25d5455b4 100644 --- a/ndp.c +++ b/ndp.c @@ -351,8 +351,13 @@ int ndp(const struct ctx *c, const struct icmp6hdr *ih,
if (ih->icmp6_type == NS) { const struct ndp_ns *ns; + struct iov_tail data; + struct ndp_ns nsc;
- ns = packet_get(p, 0, 0, sizeof(struct ndp_ns), NULL); + if (!packet_base(p, 0, &data)) + return -1; + + ns = IOV_REMOVE_HEADER(&data, nsc); if (!ns) return -1;
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson