summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-08-14 11:25:25 -0700
committerDave Barach <openvpp@barachs.net>2017-08-15 12:33:31 +0000
commitab0289a85c45699878d203b4a0d2e5b38c36cc55 (patch)
tree320d8d5f267e4ec11670ded214c7f3f2a3670cd2 /src/vnet/tcp/tcp.c
parent8ddd518f9a65af77dc3294f1965452aa72cb0eb2 (diff)
tcp: state machine improvements
- Add SYN_RCVD timeout - Fix FIN_WAIT_1 to CLOSING transition Change-Id: I42ca7fc087f6fdfae15bd7a6175dd3226ed341c7 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c15
1 files changed, 11 insertions, 4 deletions
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);
}