]> git.proxmox.com Git - mirror_qemu.git/commit
nbd/server: Prepare to receive extended header requests
authorEric Blake <eblake@redhat.com>
Mon, 25 Sep 2023 19:22:32 +0000 (14:22 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 5 Oct 2023 16:02:08 +0000 (11:02 -0500)
commitc8720ca03e01cf68f23a2017586db57abe12de0f
tree54af9705dba47926e26e4ceb569bbc4d874ac882
parent009cd8665095a04115940704d680a52dcc49d489
nbd/server: Prepare to receive extended header requests

Although extended mode is not yet enabled, once we do turn it on, we
need to accept extended requests for all messages.  Previous patches
have already taken care of supporting 64-bit lengths, now we just need
to read it off the wire.

Note that this implementation will block indefinitely on a buggy
client that sends a non-extended payload (that is, we try to read a
full packet before we ever check the magic number, but a client that
mistakenly sends a simple request after negotiating extended headers
doesn't send us enough bytes), but it's no different from any other
client that stops talking to us partway through a packet and thus not
worth coding around.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID: <20230925192229.3186470-16-eblake@redhat.com>
nbd/nbd-internal.h
nbd/server.c