summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrej Kozemcak <andrej.kozemcak@pantheon.tech>2019-01-07 08:39:22 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-01-07 16:43:37 +0000
commit9d7570ccde4ded1c5feea097b10272870bfc81da (patch)
tree8b1134069f2aff34c7be5bb0810769cdb94333b8
parent7baeb71f92826ee6ef02ab2c3d16484bb64d9301 (diff)
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>
-rw-r--r--src/vnet/interface_output.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 34f0a977131..ba69d36b6c4 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -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);
}