Type: fix
Change-Id: Iccc283bb98d3bb459a711ec2b74d6a32ad12903b
Signed-off-by: Florin Coras <fcoras@cisco.com>
void
session_transport_cleanup (session_t * s)
{
- s->session_state = SESSION_STATE_CLOSED;
-
/* Delete from main lookup table before we axe the the transport */
session_lookup_del_session (s);
- if (s->session_state != SESSION_STATE_TRANSPORT_DELETED)
+ if (s->session_state < SESSION_STATE_TRANSPORT_DELETED)
transport_cleanup (session_get_transport_proto (s), s->connection_index,
s->thread_index);
/* Since we called cleanup, no delete notification will come. So, make
{
tcp_connection_t *tc;
tc = tcp_connection_get (conn_index, thread_index);
+ if (!tc)
+ return;
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
tcp_connection_cleanup (tc);
}