aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Fleytman <dmitry@daynix.com>2017-02-16 14:29:34 +0200
committerJason Wang <jasowang@redhat.com>2017-03-06 11:46:02 +0800
commitd5e772146d2bbc92e5126c145eddef3b2843d026 (patch)
treead8a2e881b1a28cb89290acf9712adc1822f3370
parentdf8bf7a7fe75eb5d5caffa55f5cd4292b757aea6 (diff)
NetRxPkt: Do not try to pull more data than present
In case of VLAN stripping, ETH header put into a separate buffer, therefore amont of data copied from original IOV should be smaller. Cc: qemu-stable@nongnu.org Signed-off-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
-rw-r--r--hw/net/net_rx_pkt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
index 3361d7ebe0..0003a0e88b 100644
--- a/hw/net/net_rx_pkt.c
+++ b/hw/net/net_rx_pkt.c
@@ -96,7 +96,8 @@ net_rx_pkt_pull_data(struct NetRxPkt *pkt,
pkt->tot_len = iov_size(iov, iovcnt) - ploff + pkt->ehdr_buf_len;
pkt->vec_len = iov_copy(pkt->vec + 1, pkt->vec_len_total - 1,
- iov, iovcnt, ploff, pkt->tot_len);
+ iov, iovcnt, ploff,
+ pkt->tot_len - pkt->ehdr_buf_len);
} else {
net_rx_pkt_iovec_realloc(pkt, iovcnt);