summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Lopez <slp@redhat.com>2020-02-21 12:49:03 +0100
committerAndreea Florescu <andreea.florescu15@gmail.com>2020-09-04 17:59:53 +0300
commit304a5a15588e36ecbd8fa2cf2b849c97c87a53bd (patch)
treedc1a286f714ecb0f63c2834c647e51a7e73e531b
parent9593c2a3e53a41d2e101e42bbb34f0199d3a618b (diff)
downloadvmm_vhost-304a5a15588e36ecbd8fa2cf2b849c97c87a53bd.tar.gz
vhost-user: Only check SLAVE_REQ for 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>
-rw-r--r--src/vhost_user/slave_req_handler.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/vhost_user/slave_req_handler.rs b/src/vhost_user/slave_req_handler.rs
index 50b8414..f3b0770 100644
--- a/src/vhost_user/slave_req_handler.rs
+++ b/src/vhost_user/slave_req_handler.rs
@@ -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)?;