summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Barach <dbarach@cisco.com>2017-08-02 09:19:32 -0400
committerKeith Burns <alagalah@gmail.com>2017-08-02 14:13:08 +0000
commitac0c96bc569b3c75186a089b810ac98db4bf5780 (patch)
treedd78e2ca73d580aebae3693fe1abef83a73b9d56 /src
parent34da892b41ee24ca06b3ed78a01b7c0ccd6c0c87 (diff)
Fix ip checksum offload, move badly-placed ASSERT
Change-Id: I5e04d618c4b4987edc64f6d82fd0a81b8362dbb0 Signed-off-by: Dave Barach <dbarach@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ip/ip4.h2
-rw-r--r--src/vnet/tcp/builtin_client.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/vnet/ip/ip4.h b/src/vnet/ip/ip4.h
index 74faa05947e..8f9a8e27bf5 100644
--- a/src/vnet/ip/ip4.h
+++ b/src/vnet/ip/ip4.h
@@ -354,6 +354,8 @@ vlib_buffer_push_ip4 (vlib_main_t * vm, vlib_buffer_t * b,
ih->checksum = 0;
b->flags |= VNET_BUFFER_F_OFFLOAD_IP_CKSUM | VNET_BUFFER_F_IS_IP4;
vnet_buffer (b)->l3_hdr_offset = (u8 *) ih - b->data;
+ vnet_buffer (b)->l4_hdr_offset = vnet_buffer (b)->l3_hdr_offset +
+ sizeof (*ih);
}
else
ih->checksum = ip4_header_checksum (ih);
diff --git a/src/vnet/tcp/builtin_client.c b/src/vnet/tcp/builtin_client.c
index 48daffb41de..0cb9faa8769 100644
--- a/src/vnet/tcp/builtin_client.c
+++ b/src/vnet/tcp/builtin_client.c
@@ -433,8 +433,6 @@ builtin_session_connected_callback (u32 app_index, u32 api_context,
u32 session_index;
u8 thread_index = vlib_get_thread_index ();
- ASSERT (s->thread_index == thread_index);
-
if (is_fail)
{
clib_warning ("connection %d failed!", api_context);
@@ -442,6 +440,8 @@ builtin_session_connected_callback (u32 app_index, u32 api_context,
return 0;
}
+ ASSERT (s->thread_index == thread_index);
+
if (!tm->vpp_event_queue[thread_index])
tm->vpp_event_queue[thread_index] =
session_manager_get_vpp_event_queue (thread_index);