summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-07-27 00:34:12 -0700
committerDave Barach <openvpp@barachs.net>2017-08-02 00:03:45 +0000
commitfdbc38249a8c672937a74667dcfaafa2cfd292e7 (patch)
tree266d4b90330e508163c560ba01226c3248d5a39c /src/vnet/tcp
parenta0a908f1dfb679c384ab34ee3c1a2a63ba2448df (diff)
Make ip csum configurable in vlib buffer functions
Also fixes csum computation for lisp control plane 4o6 encapsulated control messages. Change-Id: I991e0b5c0d16dc51e0b5bdc79e1d752270b34765 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp_output.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 1ecb6ce6071..ad13493a14c 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -675,7 +675,7 @@ tcp_make_reset_in_place (vlib_main_t * vm, vlib_buffer_t * b0,
if (is_ip4)
{
ih4 = vlib_buffer_push_ip4 (vm, b0, &dst_ip40, &src_ip40,
- IP_PROTOCOL_TCP);
+ IP_PROTOCOL_TCP, 1);
th0->checksum = ip4_tcp_udp_compute_checksum (vm, b0, ih4);
}
else
@@ -747,7 +747,7 @@ tcp_send_reset (tcp_connection_t * tc, vlib_buffer_t * pkt, u8 is_ip4)
{
ASSERT ((pkt_ih4->ip_version_and_header_length & 0xF0) == 0x40);
ih4 = vlib_buffer_push_ip4 (vm, b, &pkt_ih4->dst_address,
- &pkt_ih4->src_address, IP_PROTOCOL_TCP);
+ &pkt_ih4->src_address, IP_PROTOCOL_TCP, 1);
th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ih4);
}
else
@@ -776,7 +776,7 @@ tcp_push_ip_hdr (tcp_main_t * tm, tcp_connection_t * tc, vlib_buffer_t * b)
{
ip4_header_t *ih;
ih = vlib_buffer_push_ip4 (vm, b, &tc->c_lcl_ip4,
- &tc->c_rmt_ip4, IP_PROTOCOL_TCP);
+ &tc->c_rmt_ip4, IP_PROTOCOL_TCP, 1);
th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ih);
}
else
@@ -1508,9 +1508,10 @@ tcp46_output_inline (vlib_main_t * vm,
{
ip4_header_t *ih0;
ih0 = vlib_buffer_push_ip4 (vm, b0, &tc0->c_lcl_ip4,
- &tc0->c_rmt_ip4, IP_PROTOCOL_TCP);
- b0->flags |= VNET_BUFFER_F_IS_IP4 |
- VNET_BUFFER_F_OFFLOAD_IP_CKSUM |
+ &tc0->c_rmt_ip4, IP_PROTOCOL_TCP,
+ 1);
+ b0->flags |=
+ VNET_BUFFER_F_IS_IP4 | VNET_BUFFER_F_OFFLOAD_IP_CKSUM |
VNET_BUFFER_F_OFFLOAD_TCP_CKSUM;
vnet_buffer (b0)->l3_hdr_offset = (u8 *) ih0 - b0->data;
vnet_buffer (b0)->l4_hdr_offset = (u8 *) th0 - b0->data;