* just remove the connection, call tcp_connection_cleanup instead.
*/
void
-tcp_connection_del (tcp_connection_t * tc)
+tcp_connection_cleanup_and_notify (tcp_connection_t *tc)
{
session_transport_delete_notify (&tc->connection);
tcp_connection_cleanup (tc);
* If at the end the connection is not in CLOSED state, it is not removed.
* Instead, we rely on on TCP to advance through state machine to either
* 1) LAST_ACK (passive close) whereby when the last ACK is received
- * tcp_connection_del is called. This notifies session of the delete and
- * calls cleanup.
- * 2) TIME_WAIT (active close) whereby after 2MSL the 2MSL timer triggers
- * and cleanup is called.
- *
+ * tcp_connection_cleanup_and_notify is called. This notifies session of the
+ * delete and calls cleanup.
+ * 2) TIME_WAIT (active close) whereby after 2MSL the 2MSL timer triggers and
+ * cleanup is called.
*/
void
tcp_connection_close (tcp_connection_t * tc)
void tcp_connection_free (tcp_connection_t * tc);
void tcp_connection_close (tcp_connection_t * tc);
void tcp_connection_cleanup (tcp_connection_t * tc);
-void tcp_connection_del (tcp_connection_t * tc);
+void tcp_connection_cleanup_and_notify (tcp_connection_t *tc);
int tcp_half_open_connection_cleanup (tcp_connection_t * tc);
void tcp_send_reset_w_pkt (tcp_connection_t *tc, vlib_buffer_t *pkt,
switch (tc->rst_state)
{
case TCP_STATE_SYN_RCVD:
- /* Cleanup everything. App wasn't notified yet */
- session_transport_delete_notify (&tc->connection);
- tcp_connection_cleanup (tc);
+ /* Cleanup everything. App wasn't notified yet, but session layer must be
+ * notified that the session needs to be cleaned up. */
+ tcp_connection_cleanup_and_notify (tc);
break;
case TCP_STATE_SYN_SENT:
session_stream_connect_notify (&tc->connection, SESSION_E_REFUSED);
{
error = TCP_ERROR_MSG_QUEUE_FULL;
tcp_send_reset (tc);
- session_transport_delete_notify (&tc->connection);
- tcp_connection_cleanup (tc);
+ tcp_connection_cleanup_and_notify (tc);
goto drop;
}
error = TCP_ERROR_CONN_ACCEPTED;
lc = tcp_lookup_listener (b[0], tc->c_fib_index, is_ip4);
/* clean up the old session */
- tcp_connection_del (tc);
+ tcp_connection_cleanup_and_notify (tc);
/* listener was cleaned up */
if (!lc)
{