nbd: Don't kill server when client requests unknown option
nbd-server.c currently fails to handle unsupported options properly. If during option haggling the client sends an unknown request, the server kills the connection instead of letting the client try to fall back to something older. This is precisely what advertising NBD_FLAG_FIXED_NEWSTYLE was supposed to fix. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1459982918-32229-1-git-send-email-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6ff5816478
commit
156f6a10c2
|
@ -483,9 +483,12 @@ static int nbd_negotiate_options(NBDClient *client)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
default:
|
default:
|
||||||
TRACE("Unsupported option 0x%x", clientflags);
|
TRACE("Unsupported option 0x%x", clientflags);
|
||||||
|
if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_UNSUP,
|
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_UNSUP,
|
||||||
clientflags);
|
clientflags);
|
||||||
return -EINVAL;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue