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>
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 34f0a97..ba69d36 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -181,7 +181,10 @@
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);
}