summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-09-22 19:26:33 -0700
committerDave Wallace <dwallacelf@gmail.com>2023-10-09 21:36:45 +0000
commitee2e50273664745a56305391cb7836900fb36951 (patch)
treee5f97426f0b13f7788db05ae5042990c64fee021 /src/vnet/tls
parente7295fd974090efd882a04fa4341d38d17060578 (diff)
tls: ignore tx events for not fully established sessions
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I401a116a1a46c0dc5d591115de5ff0eef2f6440b
Diffstat (limited to 'src/vnet/tls')
-rw-r--r--src/vnet/tls/tls.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index c8ae948debe..5c07cc26a34 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -938,15 +938,18 @@ tls_cleanup_ho (u32 ho_index)
int
tls_custom_tx_callback (void *session, transport_send_params_t * sp)
{
- session_t *app_session = (session_t *) session;
+ session_t *as = (session_t *) session;
tls_ctx_t *ctx;
- if (PREDICT_FALSE (app_session->session_state
- >= SESSION_STATE_TRANSPORT_CLOSED))
- return 0;
+ if (PREDICT_FALSE (as->session_state >= SESSION_STATE_TRANSPORT_CLOSED ||
+ as->session_state <= SESSION_STATE_ACCEPTING))
+ {
+ sp->flags |= TRANSPORT_SND_F_DESCHED;
+ return 0;
+ }
- ctx = tls_ctx_get (app_session->connection_index);
- return tls_ctx_write (ctx, app_session, sp);
+ ctx = tls_ctx_get (as->connection_index);
+ return tls_ctx_write (ctx, as, sp);
}
u8 *