[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 01/13] libvhost-user: set msg.msg_control to NULL when it is e
From: |
Stefano Garzarella |
Subject: |
[PATCH v5 01/13] libvhost-user: set msg.msg_control to NULL when it is empty |
Date: |
Thu, 23 May 2024 16:55:10 +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.1
- [PATCH v5 00/13] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD), Stefano Garzarella, 2024/05/23
- [PATCH v5 01/13] libvhost-user: set msg.msg_control to NULL when it is empty,
Stefano Garzarella <=
- [PATCH v5 03/13] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported, Stefano Garzarella, 2024/05/23
- [PATCH v5 04/13] vhost-user-server: do not set memory fd non-blocking, Stefano Garzarella, 2024/05/23
- [PATCH v5 02/13] libvhost-user: fail vu_message_write() if sendmsg() is failing, Stefano Garzarella, 2024/05/23
- [PATCH v5 05/13] contrib/vhost-user-blk: fix bind() using the right size of the address, Stefano Garzarella, 2024/05/23
- [PATCH v5 06/13] contrib/vhost-user-*: use QEMU bswap helper functions, Stefano Garzarella, 2024/05/23