server: Skip option haggling from client lacking fixed newstyle
commit5caab0a226afbd6443be74fac5d24eb82f8587c4
authorEric Blake <eblake@redhat.com>
Thu, 12 Sep 2019 02:16:04 +0000 (11 21:16 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 12 Sep 2019 02:35:47 +0000 (11 21:35 -0500)
tree9c30c943c6ef3424345232b203ae4cac0b0cbca2
parentafbe7f11098df256acf8eafa9d4ec1e3cfd32910
server: Skip option haggling from client lacking fixed newstyle

The NBD protocol states that servers may still choose to honor various
NBD_OPT_* from a client that did not reply with
NBD_FLAG_C_FIXED_NEWSTYLE; however, for integration testing purposes,
it's a lot nicer if we reject everything except NBD_OPT_EXPORT_NAME
from such a client (for example, with this in place, we might have
spotted the bug fixed in commit e03b34d6 a bit sooner).  Thus, a
client that does not claim to understand fixed newstyle can now no
longer trigger TLS, structured replies, meta contexts, or the nicer
handling of NBD_OPT_GO.  All well-known clients listed in
nbdkit-protocol.pod default to requesting fixed newstyle, so this
shouldn't affect normal usage.

Signed-off-by: Eric Blake <eblake@redhat.com>
server/protocol-handshake-newstyle.c