[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/9] libvhost-user: set msg.msg_control to NULL when it is empty
From: |
Stefano Garzarella |
Subject: |
[PATCH 1/9] libvhost-user: set msg.msg_control to NULL when it is empty |
Date: |
Wed, 28 Feb 2024 12:47:51 +0100 |
From: Stefano Garzarella <stefanogarzarella@gmail.com>
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.
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 a3b158c671..b9c18eee53 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -387,6 +387,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.43.2
- [PATCH 0/9] vhost-user: support any POSIX system (tested on macOS and FreeBSD), Stefano Garzarella, 2024/02/28
- [PATCH 1/9] libvhost-user: set msg.msg_control to NULL when it is empty,
Stefano Garzarella <=
- [PATCH 2/9] libvhost-user: fail vu_message_write() if sendmsg() is failing, Stefano Garzarella, 2024/02/28
- [PATCH 4/9] vhost-user-server: don't abort if we can't set fd non-blocking, Stefano Garzarella, 2024/02/28
- [PATCH 3/9] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported, Stefano Garzarella, 2024/02/28
- [PATCH 5/9] contrib/vhost-user-blk: fix bind() using the right size of the address, Stefano Garzarella, 2024/02/28
- [PATCH 6/9] vhost-user: enable frontends on any POSIX system, Stefano Garzarella, 2024/02/28
- [PATCH 7/9] libvhost-user: enable it on any POSIX system, Stefano Garzarella, 2024/02/28
- [PATCH 8/9] contrib/vhost-user-blk: enabled it on any POSIX system, Stefano Garzarella, 2024/02/28
- [PATCH 9/9] hostmem-file: support POSIX shm_open(), Stefano Garzarella, 2024/02/28