From ab0289a85c45699878d203b4a0d2e5b38c36cc55 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 14 Aug 2017 11:25:25 -0700 Subject: tcp: state machine improvements - Add SYN_RCVD timeout - Fix FIN_WAIT_1 to CLOSING transition Change-Id: I42ca7fc087f6fdfae15bd7a6175dd3226ed341c7 Signed-off-by: Florin Coras --- src/vnet/tcp/tcp.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/vnet/tcp/tcp.c') diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 10ecf2f31f1..75c9d8dcc3d 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -1106,10 +1106,17 @@ tcp_timer_establish_handler (u32 conn_index) tcp_connection_t *tc; tc = tcp_half_open_connection_get (conn_index); - tc->timers[TCP_TIMER_ESTABLISH] = TCP_TIMER_HANDLE_INVALID; - - ASSERT (tc->state == TCP_STATE_SYN_SENT); - stream_session_connect_notify (&tc->connection, 1 /* fail */ ); + if (tc) + { + ASSERT (tc->state == TCP_STATE_SYN_SENT); + tc->timers[TCP_TIMER_ESTABLISH] = TCP_TIMER_HANDLE_INVALID; + stream_session_connect_notify (&tc->connection, 1 /* fail */ ); + } + else + { + tc = tcp_connection_get (conn_index, vlib_get_thread_index ()); + ASSERT (tc->state == TCP_STATE_SYN_RCVD); + } tcp_connection_cleanup (tc); } -- cgit 1.2.3-korg