* [Qemu-devel] [PATCH] net/filter-rewriter.c: Fix rewirter checksum bug when use virtio-net
@ 2017-07-28 10:03 Zhang Chen
2017-08-21 1:42 ` Zhang Chen
0 siblings, 1 reply; 3+ messages in thread
From: Zhang Chen @ 2017-07-28 10:03 UTC (permalink / raw)
To: qemu devel, Jason Wang; +Cc: Zhang Chen, Li Zhijian
Because vnet_hdr have a offset to net packet, we must add it when use
virtio-net.
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
net/filter-rewriter.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index 55a6cf5..72e4928 100644
--- a/net/filter-rewriter.c
+++ b/net/filter-rewriter.c
@@ -99,7 +99,8 @@ static int handle_primary_tcp_pkt(NetFilterState *nf,
/* handle packets to the secondary from the primary */
tcp_pkt->th_ack = htonl(ntohl(tcp_pkt->th_ack) + conn->offset);
- net_checksum_calculate((uint8_t *)pkt->data, pkt->size);
+ net_checksum_calculate((uint8_t *)pkt->data + pkt->vnet_hdr_len,
+ pkt->size - pkt->vnet_hdr_len);
}
}
@@ -138,7 +139,8 @@ static int handle_secondary_tcp_pkt(NetFilterState *nf,
/* handle packets to the primary from the secondary*/
tcp_pkt->th_seq = htonl(ntohl(tcp_pkt->th_seq) - conn->offset);
- net_checksum_calculate((uint8_t *)pkt->data, pkt->size);
+ net_checksum_calculate((uint8_t *)pkt->data + pkt->vnet_hdr_len,
+ pkt->size - pkt->vnet_hdr_len);
}
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] net/filter-rewriter.c: Fix rewirter checksum bug when use virtio-net
2017-07-28 10:03 [Qemu-devel] [PATCH] net/filter-rewriter.c: Fix rewirter checksum bug when use virtio-net Zhang Chen
@ 2017-08-21 1:42 ` Zhang Chen
2017-08-21 3:17 ` Jason Wang
0 siblings, 1 reply; 3+ messages in thread
From: Zhang Chen @ 2017-08-21 1:42 UTC (permalink / raw)
To: qemu devel, Jason Wang; +Cc: zhangchen.fnst, Li Zhijian
Hi~ All~
Someone can review it? Just a ping for this patch.
Thanks
Zhang Chen
On 07/28/2017 06:03 PM, Zhang Chen wrote:
> Because vnet_hdr have a offset to net packet, we must add it when use
> virtio-net.
>
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> ---
> net/filter-rewriter.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
> index 55a6cf5..72e4928 100644
> --- a/net/filter-rewriter.c
> +++ b/net/filter-rewriter.c
> @@ -99,7 +99,8 @@ static int handle_primary_tcp_pkt(NetFilterState *nf,
> /* handle packets to the secondary from the primary */
> tcp_pkt->th_ack = htonl(ntohl(tcp_pkt->th_ack) + conn->offset);
>
> - net_checksum_calculate((uint8_t *)pkt->data, pkt->size);
> + net_checksum_calculate((uint8_t *)pkt->data + pkt->vnet_hdr_len,
> + pkt->size - pkt->vnet_hdr_len);
> }
> }
>
> @@ -138,7 +139,8 @@ static int handle_secondary_tcp_pkt(NetFilterState *nf,
> /* handle packets to the primary from the secondary*/
> tcp_pkt->th_seq = htonl(ntohl(tcp_pkt->th_seq) - conn->offset);
>
> - net_checksum_calculate((uint8_t *)pkt->data, pkt->size);
> + net_checksum_calculate((uint8_t *)pkt->data + pkt->vnet_hdr_len,
> + pkt->size - pkt->vnet_hdr_len);
> }
> }
>
--
Thanks
Zhang Chen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] net/filter-rewriter.c: Fix rewirter checksum bug when use virtio-net
2017-08-21 1:42 ` Zhang Chen
@ 2017-08-21 3:17 ` Jason Wang
0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2017-08-21 3:17 UTC (permalink / raw)
To: Zhang Chen, qemu devel; +Cc: Li Zhijian
On 2017年08月21日 09:42, Zhang Chen wrote:
> Hi~ All~
>
> Someone can review it? Just a ping for this patch.
>
>
> Thanks
>
> Zhang Chen
>
Queued this for 2.11.
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-21 3:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-28 10:03 [Qemu-devel] [PATCH] net/filter-rewriter.c: Fix rewirter checksum bug when use virtio-net Zhang Chen
2017-08-21 1:42 ` Zhang Chen
2017-08-21 3:17 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).