From 30c7ef2f8c75a95f3ab78a908e3b7adc2cc4bedc Mon Sep 17 00:00:00 2001 From: John Levon Date: Tue, 1 Jun 2021 14:03:06 +0100 Subject: 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 Reviewed-by: Thanos Makatos --- samples/client.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'samples/client.c') 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); -- cgit v1.1