diff options
author | John Levon <john.levon@nutanix.com> | 2021-06-01 14:03:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 14:03:06 +0100 |
commit | 30c7ef2f8c75a95f3ab78a908e3b7adc2cc4bedc (patch) | |
tree | 159e296dc48e40e97b961b44a6b84e4a8bd1e81e /samples | |
parent | 9ed077601004c5c72665010b893ace6d8709e244 (diff) | |
download | libvfio-user-30c7ef2f8c75a95f3ab78a908e3b7adc2cc4bedc.zip libvfio-user-30c7ef2f8c75a95f3ab78a908e3b7adc2cc4bedc.tar.gz libvfio-user-30c7ef2f8c75a95f3ab78a908e3b7adc2cc4bedc.tar.bz2 |
samples/client: check for reply cmd value (#546)
With recent spec updates, we are now returning the cmd value in the reply
header, so the client can verify it.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/client.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/samples/client.c b/samples/client.c index 71bc4ac..dd73dbd 100644 --- a/samples/client.c +++ b/samples/client.c @@ -144,13 +144,10 @@ recv_version(int sock, int *server_max_fds, size_t *pgsize) err(EXIT_FAILURE, "failed to receive version"); } -// FIXME: are we out of spec? reply cmd's are zero -#if 0 if (hdr.cmd != VFIO_USER_VERSION) { - errx(EXIT_FAILURE, "msg%hx: invalid cmd %hu (expected %hu)", - msg_id, hdr.cmd, VFIO_USER_VERSION); + errx(EXIT_FAILURE, "msg%hx: invalid cmd %hu (expected %u)", + hdr.msg_id, hdr.cmd, VFIO_USER_VERSION); } -#endif if (vlen < sizeof(*sversion)) { errx(EXIT_FAILURE, "VFIO_USER_VERSION: invalid size %lu", vlen); |