aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2020-11-24 13:10:15 +0000
committerGitHub <noreply@github.com>2020-11-24 13:10:15 +0000
commitee9c3d1860bc81ebd43862d502ef2f9f71e6c299 (patch)
treebc17c5f64926bf9caeaeda86ba73d70dc15d1496 /lib
parent5d58b0a7c30fb5b5a1167dc49b1322447b139f71 (diff)
downloadlibvfio-user-ee9c3d1860bc81ebd43862d502ef2f9f71e6c299.zip
libvfio-user-ee9c3d1860bc81ebd43862d502ef2f9f71e6c299.tar.gz
libvfio-user-ee9c3d1860bc81ebd43862d502ef2f9f71e6c299.tar.bz2
get_request_sock: set nr_fds always (#116)
Diffstat (limited to 'lib')
-rw-r--r--lib/tran_sock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tran_sock.c b/lib/tran_sock.c
index 7834a77..3ad1222 100644
--- a/lib/tran_sock.c
+++ b/lib/tran_sock.c
@@ -661,6 +661,8 @@ get_request_sock(lm_ctx_t *lm_ctx, struct vfio_user_header *hdr,
msg.msg_controllen = CMSG_SPACE(sizeof(int) * *nr_fds);
msg.msg_control = alloca(msg.msg_controllen);
+ *nr_fds = 0;
+
/*
* TODO ideally we should set O_NONBLOCK on the fd so that the syscall is
* faster (?). I tried that and get short reads, so we need to store the