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>
This commit is contained in:
@ -864,7 +864,8 @@ session_transport_delete_notify (transport_connection_t * tc)
|
|||||||
/* Session was created but accept notification was not yet sent to the
|
/* Session was created but accept notification was not yet sent to the
|
||||||
* app. Cleanup everything. */
|
* app. Cleanup everything. */
|
||||||
session_lookup_del_session (s);
|
session_lookup_del_session (s);
|
||||||
session_free_w_fifos (s);
|
segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo);
|
||||||
|
session_free (s);
|
||||||
break;
|
break;
|
||||||
case SESSION_STATE_ACCEPTING:
|
case SESSION_STATE_ACCEPTING:
|
||||||
case SESSION_STATE_TRANSPORT_CLOSING:
|
case SESSION_STATE_TRANSPORT_CLOSING:
|
||||||
|
@ -358,10 +358,18 @@ void
|
|||||||
tls_session_reset_callback (session_t * s)
|
tls_session_reset_callback (session_t * s)
|
||||||
{
|
{
|
||||||
tls_ctx_t *ctx;
|
tls_ctx_t *ctx;
|
||||||
|
transport_connection_t *tc;
|
||||||
|
session_t *app_session;
|
||||||
|
|
||||||
ctx = tls_ctx_get (s->opaque);
|
ctx = tls_ctx_get (s->opaque);
|
||||||
session_transport_reset_notify (&ctx->connection);
|
tc = &ctx->connection;
|
||||||
session_transport_closed_notify (&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);
|
tls_disconnect_transport (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user