[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL RESEND 04/19] NetRxPkt: Do not try to pull more data
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL RESEND 04/19] NetRxPkt: Do not try to pull more data than present |
Date: |
Mon, 6 Mar 2017 13:25:39 +0800 |
From: Dmitry Fleytman <address@hidden>
In case of VLAN stripping, ETH header put into a
separate buffer, therefore amont of data copied
from original IOV should be smaller.
Cc: address@hidden
Signed-off-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
hw/net/net_rx_pkt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
index 3361d7e..0003a0e 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);
--
2.7.4
- [Qemu-devel] [PULL RESEND 00/19] Net patches, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 01/19] net: Remove useless local var pkt, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 02/19] eth: Extend vlan stripping functions, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 04/19] NetRxPkt: Do not try to pull more data than present,
Jason Wang <=
- [Qemu-devel] [PULL RESEND 03/19] NetRxPkt: Fix memory corruption on VLAN header stripping, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 05/19] NetRxPkt: Account buffer with ETH header in IOV length, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 06/19] NetRxPkt: Remove code duplication in net_rx_pkt_pull_data(), Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 07/19] colo-compare: use g_timeout_source_new() to process the stale packets, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 08/19] colo-compare: kick compare thread to exit after some cleanup in finalization, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 09/19] char: remove the right fd been watched in qemu_chr_fe_set_handlers(), Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 10/19] colo-compare: Fix removing fds been watched incorrectly in finalization, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 11/19] net/colo-compare: Fix memory free error, Jason Wang, 2017/03/06
- [Qemu-devel] [PULL RESEND 12/19] vmxnet3: Convert ring values to uint32_t's, Jason Wang, 2017/03/06