vhost_rs: Don't check for SLAVE_SEND_FD on SET_SLAVE_REQ_FD

SLAVE_SEND_FD and SLAVE_REQ are different protocol features. Check for
SLAVE_REQ instead.

Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
Sergio Lopez 2020-02-21 12:49:03 +01:00 committed by Rob Bradford
parent 1c5562b656
commit d8d790bb7b

View File

@ -278,9 +278,7 @@ impl<S: VhostUserSlaveReqHandler> SlaveReqHandler<S> {
self.set_config(&hdr, size, &buf)?;
}
MasterReq::SET_SLAVE_REQ_FD => {
if self.acked_protocol_features & VhostUserProtocolFeatures::SLAVE_SEND_FD.bits()
== 0
{
if self.acked_protocol_features & VhostUserProtocolFeatures::SLAVE_REQ.bits() == 0 {
return Err(Error::InvalidOperation);
}
self.set_slave_req_fd(&hdr, rfds)?;