summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_worker.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-03-27 15:06:07 +0000
committerDave Barach <openvpp@barachs.net>2020-03-30 20:34:30 +0000
commit87b7e3df2b6f0335424c338ee7d61d426ef45904 (patch)
treea9a3a568abd8575bfaae21357eba8d5aa833e97f /src/vnet/session/application_worker.c
parent102dd1cfa792f3e70679463df141fe21fc67a8ea (diff)
session udp: flag for connected udp
Type: improvement This can be used as alternative to udpc Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic3f7efe6728b25d4a8a0b61ddb36de66b4672c4f
Diffstat (limited to 'src/vnet/session/application_worker.c')
-rw-r--r--src/vnet/session/application_worker.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c
index 1793998f1e0..88ea7017d32 100644
--- a/src/vnet/session/application_worker.c
+++ b/src/vnet/session/application_worker.c
@@ -179,9 +179,14 @@ app_worker_init_listener (app_worker_t * app_wrk, session_t * ls)
hash_set (app_wrk->listeners_table, listen_session_get_handle (ls),
segment_manager_index (sm));
- if (session_transport_service_type (ls) == TRANSPORT_SERVICE_CL)
+ if (transport_connection_is_cless (session_get_transport (ls)))
{
- if (!ls->rx_fifo && app_worker_alloc_session_fifos (sm, ls))
+ if (ls->rx_fifo)
+ {
+ clib_warning ("sharing of connectionless listeners not supported");
+ return -1;
+ }
+ if (app_worker_alloc_session_fifos (sm, ls))
return -1;
}
return 0;
@@ -228,6 +233,13 @@ app_worker_stop_listen_session (app_worker_t * app_wrk, session_t * ls)
if (PREDICT_FALSE (!sm_indexp))
return;
+ /* Dealloc fifos first, if any, to avoid cleanup attempt lower */
+ if (ls->rx_fifo)
+ {
+ segment_manager_dealloc_fifos (ls->rx_fifo, ls->tx_fifo);
+ ls->tx_fifo = ls->rx_fifo = 0;
+ }
+
sm = segment_manager_get (*sm_indexp);
if (app_wrk->first_segment_manager == *sm_indexp)
{