vhost/net: larger header for virtio 1.0
authorMichael S. Tsirkin <mst@redhat.com>
Fri, 24 Oct 2014 11:23:52 +0000 (14:23 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Dec 2014 10:05:30 +0000 (12:05 +0200)
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>
drivers/vhost/net.c

index c218188c888072124015895291023b4a54f36d3f..8ff4a6dd238736a2a701cc04f740e939689cf842 100644 (file)
@@ -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)) {