aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session-apps
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-04 14:19:39 -0800
committerFlorin Coras <florin.coras@gmail.com>2019-03-06 18:41:28 +0000
commitc0737e962ca913763e4cc3aa516a2dfffe46659e (patch)
tree195ab85ca0d12e6b2f8b9a73f7f8c5a46bd3bb13 /src/vnet/session-apps
parent2c49ffeb251d4eb11368ca8f866020e317ac09fb (diff)
session: use session index instead of fifo for evt
Avoids derefrencing fifo pointers whose segments could have been unmapped. Change-Id: Ifb0b7399e424f145f3f94b769391a6f4e31bb4e6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session-apps')
-rw-r--r--src/vnet/session-apps/echo_client.c6
-rw-r--r--src/vnet/session-apps/proxy.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c
index 4d8089cde1b..c15798dedee 100644
--- a/src/vnet/session-apps/echo_client.c
+++ b/src/vnet/session-apps/echo_client.c
@@ -62,7 +62,8 @@ send_data_chunk (echo_client_main_t * ecm, eclient_session_t * s)
svm_fifo_t *f = s->data.tx_fifo;
rv = clib_min (svm_fifo_max_enqueue (f), bytes_this_chunk);
svm_fifo_enqueue_nocopy (f, rv);
- session_send_io_evt_to_thread_custom (f, s->thread_index,
+ session_send_io_evt_to_thread_custom (&f->master_session_index,
+ s->thread_index,
SESSION_IO_EVT_TX);
}
else
@@ -95,7 +96,8 @@ send_data_chunk (echo_client_main_t * ecm, eclient_session_t * s)
hdr.lcl_port = at->lcl_port;
svm_fifo_enqueue_nowait (f, sizeof (hdr), (u8 *) & hdr);
svm_fifo_enqueue_nocopy (f, rv);
- session_send_io_evt_to_thread_custom (f, s->thread_index,
+ session_send_io_evt_to_thread_custom (&f->master_session_index,
+ s->thread_index,
SESSION_IO_EVT_TX);
}
else
diff --git a/src/vnet/session-apps/proxy.c b/src/vnet/session-apps/proxy.c
index 1ee5f5a741c..2e03ccc9f91 100644
--- a/src/vnet/session-apps/proxy.c
+++ b/src/vnet/session-apps/proxy.c
@@ -212,7 +212,8 @@ proxy_rx_callback (session_t * s)
if (svm_fifo_set_event (active_open_tx_fifo))
{
u32 ao_thread_index = active_open_tx_fifo->master_thread_index;
- if (session_send_io_evt_to_thread_custom (active_open_tx_fifo,
+ u32 ao_session_index = active_open_tx_fifo->master_session_index;
+ if (session_send_io_evt_to_thread_custom (&ao_session_index,
ao_thread_index,
SESSION_IO_EVT_TX))
clib_warning ("failed to enqueue tx evt");
@@ -356,7 +357,8 @@ active_open_rx_callback (session_t * s)
if (svm_fifo_set_event (proxy_tx_fifo))
{
u8 thread_index = proxy_tx_fifo->master_thread_index;
- return session_send_io_evt_to_thread_custom (proxy_tx_fifo,
+ u32 session_index = proxy_tx_fifo->master_session_index;
+ return session_send_io_evt_to_thread_custom (&session_index,
thread_index,
SESSION_IO_EVT_TX);
}