diff options
author | Florin Coras <fcoras@cisco.com> | 2018-10-17 10:41:28 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-10-18 16:10:12 +0000 |
commit | c5347d9d42866881fa3f267e76bee828dfc9e1bc (patch) | |
tree | 9c4467711279a85fd204326be673f1c13b2c946a /src | |
parent | b4d2c967f86b4cc0d8d772abafdb6dbf3f11de04 (diff) |
tcp: fix cleanup of non established connections (VPP-1463)
- fix delete of connection in syn-received
- fix delete of half-open connection
Change-Id: I72ff4b60406a2762d998328c52f41adea40d2c1b
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/session/session.c | 1 | ||||
-rw-r--r-- | src/vnet/tcp/tcp.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 7b50950fe01..23d258ffdea 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -820,6 +820,7 @@ stream_session_delete_notify (transport_connection_t * tc) session_lookup_del_session (s); break; case SESSION_STATE_CLOSED: + case SESSION_STATE_ACCEPTING: stream_session_delete (s); break; } diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 884602deb6f..5378de1c1da 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -210,7 +210,8 @@ tcp_connection_cleanup (tcp_connection_t * tc) /* Try to remove the half-open connection. If this is not the owning * thread, tc won't be removed. Retransmit or establish timers will * eventually expire and call again cleanup on the right thread. */ - tcp_half_open_connection_cleanup (tc); + if (tcp_half_open_connection_cleanup (tc)) + tc->flags |= TCP_CONN_HALF_OPEN_DONE; } else { @@ -322,8 +323,10 @@ tcp_connection_close (tcp_connection_t * tc) tc->state = TCP_STATE_CLOSED; break; case TCP_STATE_SYN_RCVD: + tcp_connection_timers_reset (tc); tcp_send_fin (tc); tc->state = TCP_STATE_FIN_WAIT_1; + tcp_timer_update (tc, TCP_TIMER_WAITCLOSE, TCP_CLEANUP_TIME); break; case TCP_STATE_ESTABLISHED: if (!session_tx_fifo_max_dequeue (&tc->connection)) |