summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls
diff options
context:
space:
mode:
authorZeyu Zhang <zeyu.zhang@intel.com>2019-10-12 14:21:59 +0800
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-05 10:35:25 +0000
commit00413d3fed1fc258f836b72297ee8edddc1a9548 (patch)
treecc78aff7c59e35f18ca488a831fd5f59b65a9003 /src/vnet/tls
parentbf2aa86fe9a06722671bfc6f1ad87bccf444cbce (diff)
tls: fix on tcp connection reset
VPP would fail in tcp_connection_reset() if the tls or app session was just created. Type: fix Change-Id: I45d107f57e4f3fc468c15ca3392d5e1c413bd690 Signed-off-by: Zeyu Zhang <zeyu.zhang@intel.com> (cherry picked from commit cbbc4a2558eca8d78e0bd713ff58c54e294b1819)
Diffstat (limited to 'src/vnet/tls')
-rw-r--r--src/vnet/tls/tls.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 67807d36cc7..f2243e677b7 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -358,10 +358,18 @@ void
tls_session_reset_callback (session_t * s)
{
tls_ctx_t *ctx;
+ transport_connection_t *tc;
+ session_t *app_session;
ctx = tls_ctx_get (s->opaque);
- session_transport_reset_notify (&ctx->connection);
- session_transport_closed_notify (&ctx->connection);
+ tc = &ctx->connection;
+ if (tls_ctx_handshake_is_over (ctx))
+ {
+ session_transport_reset_notify (tc);
+ session_transport_closed_notify (tc);
+ }
+ else if ((app_session = session_get (tc->s_index, tc->thread_index)))
+ session_free (app_session);
tls_disconnect_transport (ctx);
}