summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/session.c4
-rw-r--r--src/vnet/tcp/tcp.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index cc9f4a825c4..47f7326fffb 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1279,11 +1279,9 @@ session_transport_reset (session_t * s)
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
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 2ea4e51f940..12e241984cf 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -475,6 +475,8 @@ tcp_session_cleanup (u32 conn_index, u32 thread_index)
{
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);
}