aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-10-28 16:41:26 -0700
committerDave Barach <openvpp@barachs.net>2020-10-29 21:31:25 +0000
commit06ac4bbc3234d8538b12c5b7c101a3ee56616e2a (patch)
tree8a0f297614b80cb4492f66efaffc733d2671aa07 /src/vnet/session
parentd6894568709b59625f03e92595e0686b05f2167a (diff)
session: fix ct cleanup before full establishement
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I58fb0e05f62eae45818c23e8e148ff6758ba463a
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application_local.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c
index 9de987d7c31..dc777562d00 100644
--- a/src/vnet/session/application_local.c
+++ b/src/vnet/session/application_local.c
@@ -274,6 +274,7 @@ ct_accept_rpc_wrk_handler (void *accept_args)
clib_memcpy (&cct->c_rmt_ip, &args->ip, sizeof (args->ip));
cct->actual_tp = ll_ct->actual_tp;
cct->is_client = 1;
+ cct->c_s_index = ~0;
/*
* Init server transport
@@ -465,7 +466,11 @@ ct_session_close (u32 ct_index, u32 thread_index)
if (peer_ct)
{
peer_ct->peer_index = ~0;
- session_transport_closing_notify (&peer_ct->connection);
+ /* Make sure session was allocated */
+ if (peer_ct->c_s_index != ~0)
+ session_transport_closing_notify (&peer_ct->connection);
+ else
+ ct_connection_free (peer_ct);
}
s = session_get (ct->c_s_index, ct->c_thread_index);