diff options
author | Jason Wang <jasowang@redhat.com> | 2014-11-20 09:31:05 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-21 20:59:19 +0100 |
commit | 7cc76f51508219a74dca835745e4f84393820017 (patch) | |
tree | ce85b76a4947f86157ae0272dda1e67fd766fea3 /drivers/net/macvtap.c | |
parent | mlx4: don't duplicate kvfree() (diff) | |
download | linux-7cc76f51508219a74dca835745e4f84393820017.tar.xz linux-7cc76f51508219a74dca835745e4f84393820017.zip |
macvtap: advance iov iterator when needed in macvtap_put_user()
When mergeable buffer is used, vnet_hdr_sz is greater than sizeof struct
virtio_net_hdr. So we need advance the iov iterators in this case.
Fixes 6c36d2e26cda1ad3e2c4b90dd843825fc62fe5b4 ("macvtap: Use iovec iterators")
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/macvtap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index cea99d4a8263..42a80d3de839 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -797,6 +797,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) != sizeof(vnet_hdr)) return -EFAULT; + + iov_iter_advance(iter, vnet_hdr_len - sizeof(vnet_hdr)); } total = vnet_hdr_len; total += skb->len; |