The NBD spec was clarified to state that a payload for NBD_CMD_READ
must NOT be sent unless the error field is zero (see
https://github.com/NetworkBlockDevice/nbd/commit/e6c6fb39);
doing this makes us compatible with nbd-server and qemu-nbd.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/connections.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/connections.c b/src/connections.c
index 8d65e2a..46609f0 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -1016,7 +1016,7 @@ recv_request_send_reply (struct connection *conn)
}
/* Send the read data buffer. */
- if (cmd == NBD_CMD_READ) {
+ if (cmd == NBD_CMD_READ && !error) {
r = conn->send (conn, buf, count);
if (r == -1) {
nbdkit_error ("write data: %m");
--
2.13.6