aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMattias Nissler <122288598+mnissler-rivos@users.noreply.github.com>2023-08-30 17:19:50 +0200
committerGitHub <noreply@github.com>2023-08-30 16:19:50 +0100
commitf981913abd9a5926d38a48c6ba9b1ba7dacb1c11 (patch)
treefd987030168cc14095322664e86feaefaa362582 /test
parent149aa845b11bd13fca41dcf65b51283f83ac5520 (diff)
downloadlibvfio-user-f981913abd9a5926d38a48c6ba9b1ba7dacb1c11.zip
libvfio-user-f981913abd9a5926d38a48c6ba9b1ba7dacb1c11.tar.gz
libvfio-user-f981913abd9a5926d38a48c6ba9b1ba7dacb1c11.tar.bz2
Replace protocol header flags bit field with mask (#773)
It turns out that the bit field will not yield the desired / specified bit layout on big-endian systems, see issue #768 for details. Thus, replace the bit field with constants for the individual fields and use bit masking when accessing the flags field. Signed-off-by: Mattias Nissler <mnissler@rivosinc.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'test')
-rw-r--r--test/unit-tests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit-tests.c b/test/unit-tests.c
index 0fd4fe7..310eb23 100644
--- a/test/unit-tests.c
+++ b/test/unit-tests.c
@@ -105,7 +105,7 @@ setup(void **state UNUSED)
memset(&msg, 0, sizeof(msg));
- msg.hdr.flags.type = VFIO_USER_F_TYPE_COMMAND;
+ msg.hdr.flags |= VFIO_USER_F_TYPE_COMMAND;
msg.hdr.msg_size = sizeof(msg.hdr);
fds[0] = fds[1] = -1;