]> git.ipfire.org Git - thirdparty/qemu.git/commit
nbd/server: fix nbd_negotiate_handle_info
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Wed, 1 Nov 2017 15:42:03 +0000 (18:42 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 6 Dec 2017 17:49:26 +0000 (11:49 -0600)
commitb01b1609e659863e7cdabc9eaad1514b8393ca78
treeaadd07cd7623bcf847bc0126888f1aa4f2018980
parent82ded5166b82c16978526fe748db771c19efb794
nbd/server: fix nbd_negotiate_handle_info

namelen should be here, length is unrelated, and always 0 at this
point.  Broken in introduction in commit f37708f6, but mostly
harmless (replying with '' as the name does not violate protocol,
and does not confuse qemu as the nbd client since our implementation
does not ask for the name; but might confuse some other client that
does ask for the name especially if the default export is different
than the export name being queried).

Adding an assert makes it obvious that we are not skipping any bytes
in the client's message, as well as making it obvious that we were
using the wrong variable.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
CC: qemu-stable@nongnu.org
Message-Id: <20171101154204.27146-1-vsementsov@virtuozzo.com>
[eblake: improve commit message, squash in assert addition]
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 46321d6b5f8c880932a6b3d07bd0ff6f892e665c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
nbd/server.c