From 065a1b241dde2ab6fe333ccf5bc057e7e327f8d4 Mon Sep 17 00:00:00 2001 From: Alex Bligh Date: Wed, 18 May 2011 19:02:48 +0100 Subject: [PATCH] copy handle on all requests --- nbd-server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nbd-server.c b/nbd-server.c index 21fa563..4122cef 100644 --- a/nbd-server.c +++ b/nbd-server.c @@ -1452,8 +1452,9 @@ int mainloop(CLIENT *client) { "READ", (unsigned long long)request.from, (unsigned long long)request.from / 512, len); #endif + memcpy(reply.handle, request.handle, sizeof(reply.handle)); + if ((command==NBD_CMD_WRITE) || (command==NBD_CMD_READ)) { - memcpy(reply.handle, request.handle, sizeof(reply.handle)); if ((request.from + len) > (OFFT_MAX)) { DEBUG("[Number too large!]"); ERROR(client, reply, EINVAL); -- 1.7.10.4