summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/session/application_local.c12
-rw-r--r--src/vnet/session/application_local.h3
2 files changed, 14 insertions, 1 deletions
diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c
index b14386a9b00..8fd3d44efe0 100644
--- a/src/vnet/session/application_local.c
+++ b/src/vnet/session/application_local.c
@@ -1034,6 +1034,8 @@ global_scope:
static inline int
ct_close_is_reset (ct_connection_t *ct, session_t *s)
{
+ if (ct->flags & CT_CONN_F_RESET)
+ return 1;
if (ct->flags & CT_CONN_F_CLIENT)
return (svm_fifo_max_dequeue (ct->client_rx_fifo) > 0);
else
@@ -1194,6 +1196,15 @@ ct_session_close (u32 ct_index, u32 thread_index)
ct_program_cleanup (ct);
}
+static void
+ct_session_reset (u32 ct_index, u32 thread_index)
+{
+ ct_connection_t *ct;
+ ct = ct_connection_get (ct_index, thread_index);
+ ct->flags |= CT_CONN_F_RESET;
+ ct_session_close (ct_index, thread_index);
+}
+
static transport_connection_t *
ct_session_get (u32 ct_index, u32 thread_index)
{
@@ -1358,6 +1369,7 @@ static const transport_proto_vft_t cut_thru_proto = {
.cleanup_ho = ct_cleanup_ho,
.connect = ct_session_connect,
.close = ct_session_close,
+ .reset = ct_session_reset,
.custom_tx = ct_custom_tx,
.app_rx_evt = ct_app_rx_evt,
.format_listener = format_ct_listener,
diff --git a/src/vnet/session/application_local.h b/src/vnet/session/application_local.h
index 86edf243b22..fd2804c7baf 100644
--- a/src/vnet/session/application_local.h
+++ b/src/vnet/session/application_local.h
@@ -22,7 +22,8 @@
#define foreach_ct_flags \
_ (CLIENT, "client") \
- _ (HALF_OPEN, "half-open")
+ _ (HALF_OPEN, "half-open") \
+ _ (RESET, "reset")
enum
{