Use packet_data() and extract headers using IOV_REMOVE_HEADER() rather than packet_get(). Signed-off-by: Laurent Vivier <lvivier(a)redhat.com> Reviewed-by: David Gibson <david(a)gibson.dropbear.id.au> --- ndp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ndp.c b/ndp.c index ded2081ddd1d..b09a1a133f56 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_data(p, 0, &data)) + return -1; + + ns = IOV_REMOVE_HEADER(&data, nsc); if (!ns) return -1; -- 2.49.0