[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/5] NetRxPkt: Account buffer with ETH header in IOV
From: |
Dmitry Fleytman |
Subject: |
[Qemu-devel] [PATCH 4/5] NetRxPkt: Account buffer with ETH header in IOV length |
Date: |
Thu, 16 Feb 2017 14:29:35 +0200 |
In case of VLAN stripping ETH header is stored in a
separate chunk and length of IOV should take this into
account.
This patch fixes checksum validation for RX packets
with VLAN header.
Devices affected by this problem: e1000e and vmxnet3.
Signed-off-by: Dmitry Fleytman <address@hidden>
---
hw/net/net_rx_pkt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
index d38babe..c7ae33d 100644
--- a/hw/net/net_rx_pkt.c
+++ b/hw/net/net_rx_pkt.c
@@ -97,7 +97,7 @@ 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 - pkt->ehdr_buf_len);
+ pkt->tot_len - pkt->ehdr_buf_len) + 1;
} else {
net_rx_pkt_iovec_realloc(pkt, iovcnt);
--
2.7.4
- [Qemu-devel] [PATCH 0/5] A few VLAN-related bugfixes for RX packet abstraction, Dmitry Fleytman, 2017/02/16
- [Qemu-devel] [PATCH 1/5] eth: Extend vlan stripping functions, Dmitry Fleytman, 2017/02/16
- [Qemu-devel] [PATCH 2/5] NetRxPkt: Fix memory corruption on VLAN header stripping, Dmitry Fleytman, 2017/02/16
- [Qemu-devel] [PATCH 3/5] NetRxPkt: Do not try to pull more data than present, Dmitry Fleytman, 2017/02/16
- [Qemu-devel] [PATCH 4/5] NetRxPkt: Account buffer with ETH header in IOV length,
Dmitry Fleytman <=
- [Qemu-devel] [PATCH 5/5] NetRxPkt: Remove code duplication in net_rx_pkt_pull_data(), Dmitry Fleytman, 2017/02/16
- Re: [Qemu-devel] [PATCH 0/5] A few VLAN-related bugfixes for RX packet abstraction, Peter Maydell, 2017/02/16
- Re: [Qemu-devel] [PATCH 0/5] A few VLAN-related bugfixes for RX packet abstraction, Jason Wang, 2017/02/16