[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 02/13] libvhost-user: set msg.msg_control to NULL when it is e
From: |
Stefano Garzarella |
Subject: |
[PATCH v8 02/13] libvhost-user: set msg.msg_control to NULL when it is empty |
Date: |
Tue, 18 Jun 2024 12:00:32 +0200 |
On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if
the `struct msghdr` has the field `msg_controllen` set to 0, but
`msg_control` is not NULL.
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
subprojects/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index a879149fef..22bea0c775 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -632,6 +632,7 @@ vu_message_write(VuDev *dev, int conn_fd, VhostUserMsg
*vmsg)
memcpy(CMSG_DATA(cmsg), vmsg->fds, fdsize);
} else {
msg.msg_controllen = 0;
+ msg.msg_control = NULL;
}
do {
--
2.45.2
- [PATCH v8 00/13] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD), Stefano Garzarella, 2024/06/18
- [PATCH v8 01/13] qapi: clarify that the default is backend dependent, Stefano Garzarella, 2024/06/18
- [PATCH v8 02/13] libvhost-user: set msg.msg_control to NULL when it is empty,
Stefano Garzarella <=
- [PATCH v8 03/13] libvhost-user: fail vu_message_write() if sendmsg() is failing, Stefano Garzarella, 2024/06/18
- [PATCH v8 04/13] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported, Stefano Garzarella, 2024/06/18
- [PATCH v8 05/13] vhost-user-server: do not set memory fd non-blocking, Stefano Garzarella, 2024/06/18
- [PATCH v8 06/13] contrib/vhost-user-blk: fix bind() using the right size of the address, Stefano Garzarella, 2024/06/18
- [PATCH v8 07/13] contrib/vhost-user-*: use QEMU bswap helper functions, Stefano Garzarella, 2024/06/18
- [PATCH v8 08/13] vhost-user: enable frontends on any POSIX system, Stefano Garzarella, 2024/06/18
- [PATCH v8 09/13] libvhost-user: enable it on any POSIX system, Stefano Garzarella, 2024/06/18
- [PATCH v8 10/13] contrib/vhost-user-blk: enable it on any POSIX system, Stefano Garzarella, 2024/06/18
- [PATCH v8 11/13] hostmem: add a new memory backend based on POSIX shm_open(), Stefano Garzarella, 2024/06/18
- [PATCH v8 12/13] tests/qtest/vhost-user-blk-test: use memory-backend-shm, Stefano Garzarella, 2024/06/18