aboutsummaryrefslogtreecommitdiff
path: root/nbd/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'nbd/client.c')
-rw-r--r--nbd/client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nbd/client.c b/nbd/client.c
index 31b88f3a31..bb8981f4f4 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -572,7 +572,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint32_t *flags,
error_setg(errp, "Failed to read export flags");
goto fail;
}
- *flags = be32_to_cpup(flags);
+ *flags = be32_to_cpu(*flags);
} else {
error_setg(errp, "Bad magic received");
goto fail;
@@ -726,9 +726,9 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, struct nbd_reply *reply)
[ 7 .. 15] handle
*/
- magic = be32_to_cpup((uint32_t*)buf);
- reply->error = be32_to_cpup((uint32_t*)(buf + 4));
- reply->handle = be64_to_cpup((uint64_t*)(buf + 8));
+ magic = ldl_be_p(buf);
+ reply->error = ldl_be_p(buf + 4);
+ reply->handle = ldq_be_p(buf + 8);
reply->error = nbd_errno_to_system_errno(reply->error);