aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_input.c
diff options
context:
space:
mode:
authorDave Barach <dbarach@cisco.com>2017-05-15 16:27:05 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-05-16 16:50:10 +0000
commit259cdaeccb70ea1a45b422218d3f5e1920459db8 (patch)
tree1a3d8b5196186882cfe15a65a3a3fe9eef53cebd /src/vnet/tcp/tcp_input.c
parentf73dae3c45b8fd8c0d9e26d386c56a90cfaf67fd (diff)
Fixes to tcp active opens and reception
- Properly initialize connection index - Add new session to main hash table - Drop packets that are completely in the past with respect to the rcv wnd (e.g., retransmits due to premature timer pops) Change-Id: Ic0873018ff0a4c59e0913863dc7f0c0f822d5c34 Signed-off-by: Dave Barach <dbarach@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_input.c')
-rw-r--r--src/vnet/tcp/tcp_input.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index 318d8ec5..ddee41e0 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -1135,6 +1135,10 @@ tcp_segment_rcv (tcp_main_t * tm, tcp_connection_t * tc, vlib_buffer_t * b,
error = TCP_ERROR_SEGMENT_OLD;
*next0 = TCP_NEXT_DROP;
+ /* Completely in the past (possible retransmit) */
+ if (seq_lt (vnet_buffer (b)->tcp.seq_end, tc->rcv_nxt))
+ goto done;
+
/* Chop off the bytes in the past */
n_bytes_to_drop = tc->rcv_nxt - vnet_buffer (b)->tcp.seq_number;
n_data_bytes -= n_bytes_to_drop;
@@ -1553,6 +1557,7 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
clib_memcpy (new_tc0, tc0, sizeof (*new_tc0));
new_tc0->c_thread_index = my_thread_index;
+ new_tc0->c_c_index = new_tc0 - tm->connections[my_thread_index];
/* Cleanup half-open connection XXX lock */
pool_put (tm->half_open_connections, tc0);