Ensure all options have option length
authorAlex Bligh <alex@alex.org.uk>
Mon, 16 May 2011 09:35:07 +0000 (10:35 +0100)
committerWouter Verhelst <w@uter.be>
Mon, 16 May 2011 11:59:42 +0000 (13:59 +0200)
commit9281cbf8c0d9f763b9bfe99938b0bc24694c2128
tree62923b3e691d53e333d6aed1f2297f97cfcb6571
parent65ff675de751c825dda53a40ddc0d7ead4f1b3e0
Ensure all options have option length

This is a documentation only patch to the new handshake protocol, but
changes the protocol in completely back compatible manner.

Under the current handshake protocol, it is impliedly necessary for the
server to understand every option presented by the client, as there is
no way for the server to skip options it does not understand (as the
length field is not always part of the option).

My proposal is to include the length field as a 32 bit unsigned length
in the same way that it currently forms the first 4 octets of the
NBD_OPT_EXPORT_NAME. So the length field has technically moved out
of the option data and into the option header (obviously there is
no code change required). This will allow servers to skip options
presented by clients that the server does not understand.

--
Alex Bligh

Signed-off-by: Alex Bligh <alex@alex.org.uk>
doc/proto.txt