On Thu, 17 Apr 2025 18:51:12 +0200
Laurent Vivier
Modify the interface of packet_add_do() to take an iov_tail rather than a memory pointer aand length.
Internally it only supports iovec array with only one entries, after being pruned. We can accept iovec array with several entries if the offset allows the function to reduce the number of entries to 1.
tap4_handler() is updated to create an iov_tail value using IOV_TAIL_FROM_BUF() from the buffer and the length.
Signed-off-by: Laurent Vivier
Reviewed-by: David Gibson --- iov.h | 1 + packet.c | 15 ++++++++++++--- packet.h | 7 ++++--- tap.c | 32 ++++++++++++++++++-------------- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/iov.h b/iov.h index a6e0f41e8033..b15a300131b9 100644 --- a/iov.h +++ b/iov.h @@ -17,6 +17,7 @@
#include
#include +#include
I guess this is a left-over from a previous version adding a bool. At least, gcc doesn't complain if I don't include it here (not necessarily a good reason, sometimes with glibc headers are included in surprising ways... but still I guess it's a left-over). The rest of this patch looks good to me. -- Stefano