summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
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/session.c
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/session.c')
-rw-r--r--src/vnet/session/session.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 6e24d562f98..0a294dc6be1 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -66,7 +66,7 @@ session_send_evt_to_thread (void *data, void *args, u32 thread_index,
case SESSION_IO_EVT_TX:
case SESSION_IO_EVT_TX_FLUSH:
case SESSION_IO_EVT_BUILTIN_RX:
- evt->fifo = data;
+ evt->session_index = *(u32 *) data;
break;
case SESSION_IO_EVT_BUILTIN_TX:
case SESSION_CTRL_EVT_CLOSE:
@@ -85,7 +85,8 @@ session_send_evt_to_thread (void *data, void *args, u32 thread_index,
int
session_send_io_evt_to_thread (svm_fifo_t * f, session_evt_type_t evt_type)
{
- return session_send_evt_to_thread (f, 0, f->master_thread_index, evt_type);
+ return session_send_evt_to_thread (&f->master_session_index, 0,
+ f->master_thread_index, evt_type);
}
int
@@ -560,7 +561,7 @@ session_main_flush_enqueue_events (u8 transport_proto, u32 thread_index)
continue;
}
- if (svm_fifo_is_empty (s->rx_fifo))
+ if (svm_fifo_has_event (s->rx_fifo) || svm_fifo_is_empty (s->rx_fifo))
continue;
if (PREDICT_FALSE (session_enqueue_notify_inline (s)))