From: Michael S. Tsirkin Date: Fri, 24 Oct 2014 11:23:52 +0000 (+0300) Subject: vhost/net: larger header for virtio 1.0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e4fca7d6ff1a8f784336b04aff3278cb7fc76332;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git vhost/net: larger header for virtio 1.0 Signed-off-by: Michael S. Tsirkin Reviewed-by: Jason Wang Reviewed-by: Cornelia Huck --- 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)) {