diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2026-03-06 12:51:19 +0100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-03-10 15:26:43 +0100 |
| commit | 045560c20a45a452ca1ed79b15fb01d9da5421e4 (patch) | |
| tree | 2eb088f3303996ed892e440a227412763efc093d /doc/platform-requirements/git: | |
| parent | 994bb76578645d181d315e4001d5fc0dfc92fcf6 (diff) | |
| download | passt-045560c20a45a452ca1ed79b15fb01d9da5421e4.tar passt-045560c20a45a452ca1ed79b15fb01d9da5421e4.tar.gz passt-045560c20a45a452ca1ed79b15fb01d9da5421e4.tar.bz2 passt-045560c20a45a452ca1ed79b15fb01d9da5421e4.tar.lz passt-045560c20a45a452ca1ed79b15fb01d9da5421e4.tar.xz passt-045560c20a45a452ca1ed79b15fb01d9da5421e4.tar.zst passt-045560c20a45a452ca1ed79b15fb01d9da5421e4.zip | |
iov: Add iov_truncate() helper and use it in vu handlers
Add a generic iov_truncate() function that truncates an IO vector to a
given number of bytes, returning the number of iov entries that contain
data after truncation.
Use it in udp_vu_sock_recv() and tcp_vu_sock_recv() to replace the
open-coded truncation logic that adjusted iov entries after recvmsg().
Also convert the direct iov_len assignment in tcp_vu_send_flag() to use
iov_truncate() for consistency.
Add an ASSERT() in tcp_vu_data_from_sock() to quiet the Coverity error:
passt/tcp_vu.c:457:3:
19. overflow_const: Expression "dlen + hdrlen", where "dlen" is known to
be equal to -86, and "hdrlen" is known to be equal to 86, underflows
the type of "dlen + hdrlen", which is type "unsigned long".
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>
Diffstat (limited to 'doc/platform-requirements/git:')
0 files changed, 0 insertions, 0 deletions
