Fix TCP checksum.

Set TCP checksum to zero, before calculate the TCP checksum.

Change-Id: Id96743334481804b8ebb74afef2f1dbfed29e0cb
Signed-off-by: Andrej Kozemcak <andrej.kozemcak@pantheon.tech>
This commit is contained in:
Andrej Kozemcak
2019-01-07 08:39:22 +01:00
committed by Florin Coras
parent 7baeb71f92
commit 9d7570ccde

View File

@ -181,7 +181,10 @@ calc_checksums (vlib_main_t * vm, vlib_buffer_t * b)
if (b->flags & VNET_BUFFER_F_OFFLOAD_IP_CKSUM)
ip4->checksum = ip4_header_checksum (ip4);
if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM)
th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4);
{
th->checksum = 0;
th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4);
}
if (b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM)
uh->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4);
}