diff options
author | Florin Coras <fcoras@cisco.com> | 2019-03-04 14:19:39 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-03-06 18:41:28 +0000 |
commit | c0737e962ca913763e4cc3aa516a2dfffe46659e (patch) | |
tree | 195ab85ca0d12e6b2f8b9a73f7f8c5a46bd3bb13 /src/vnet/session/session_node.c | |
parent | 2c49ffeb251d4eb11368ca8f866020e317ac09fb (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_node.c')
-rw-r--r-- | src/vnet/session/session_node.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index db5123b8b2d..7cbd0d9ab04 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -821,7 +821,7 @@ session_tx_fifo_dequeue_internal (vlib_main_t * vm, session_t *s = wrk->ctx.s; application_t *app; - if (PREDICT_FALSE (s->session_state == SESSION_STATE_CLOSED)) + if (PREDICT_FALSE (s->session_state >= SESSION_STATE_TRANSPORT_CLOSED)) return 0; app = application_get (s->t_app_index); svm_fifo_unset_event (s->tx_fifo); @@ -831,7 +831,7 @@ session_tx_fifo_dequeue_internal (vlib_main_t * vm, always_inline session_t * session_event_get_session (session_event_t * e, u8 thread_index) { - return session_get_if_valid (e->fifo->master_session_index, thread_index); + return session_get_if_valid (e->session_index, thread_index); } static void @@ -1103,7 +1103,7 @@ session_node_cmp_event (session_event_t * e, svm_fifo_t * f) case SESSION_IO_EVT_RX: case SESSION_IO_EVT_TX: case SESSION_IO_EVT_BUILTIN_RX: - if (e->fifo == f) + if (e->session_index == f->master_session_index) return 1; break; case SESSION_CTRL_EVT_CLOSE: |