summaryrefslogtreecommitdiff
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-24 14:23:52 +0300
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 12:05:30 +0200
commite4fca7d6ff1a8f784336b04aff3278cb7fc76332 (patch)
treebbb1f14c56e25d2c3722b0d5ada74f74d64add55 /drivers/vhost/net.c
parent8b38694a2dc8b18374310df50174f1e4376d6824 (diff)
vhost/net: larger header for virtio 1.0
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index c218188c8880..8ff4a6dd2387 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -1030,7 +1030,8 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features)
size_t vhost_hlen, sock_hlen, hdr_len;
int i;
- hdr_len = (features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ?
+ hdr_len = (features & ((1ULL << VIRTIO_NET_F_MRG_RXBUF) |
+ (1ULL << VIRTIO_F_VERSION_1))) ?
sizeof(struct virtio_net_hdr_mrg_rxbuf) :
sizeof(struct virtio_net_hdr);
if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) {