Re: [Nbd] Processing client's option list
- To: Wouter Verhelst <w@...112...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] Processing client's option list
- From: Alex Bligh <alex@...872...>
- Date: Sun, 29 May 2011 10:59:37 +0100
- Message-id: <E022556919896F932C8A3A14@...874...>
- Reply-to: Alex Bligh <alex@...872...>
- In-reply-to: <20110529092914.GC23363@...510...>
- References: <8BCC20F6E60432780CDEB0A8@...874...> <20110529092914.GC23363@...510...>
Wouter,
--On 29 May 2011 11:29:14 +0200 Wouter Verhelst <w@...112...> wrote:
I overlooked that when I defined the new negotiation. Worse, it's not
possible to add new messages without breaking the protocol, since the
server doesn't currently ignore any options it doesn't know about.
So, here's a suggestion:
- The server sets a flag "I have a fixed new-style negotiation
implementation"
- The client replies with a similar flag.
- Only if both client and server have set that bit can extra options be
used. In that case, the server must continue reading data until it
reads a packet NBD_OPT_END, with zero length. It must echo that back
to the client when it has nothing more to say.
- The server must not send any data to the client beyond what is
required for any explicit requests by the client and the NBD_OPT_END
packet.
This way, both the client and the server will know when negotiation is
finished, even if one or the other does not implement an option that is
requested by the other end.
I don't think you mean "packet". I think you just mean "option". They
need not be separate tcp packets. Otherwise yes, I agree.
Alternatively, if we have room, perhaps the server could indicate
what protocol revision it supports, then the client could reply
with a number less than or equal to that, and we could just do
revisions of protocols, rather than trying to support all sorts
of different things orthogonally.
--
Alex Bligh
Reply to: