From 5724aecd20e8f5e50aba418d2a021ef02275d589 Mon Sep 17 00:00:00 2001 From: liuyacan Date: Fri, 23 Apr 2021 09:38:38 +0800 Subject: session: set fifo's session index before vcl attach Current implementation may have timing issue: 1. The TCP 3-way-handshake is completed but the app is busy and does not process the CONNECTED event. 2. VPP receive some data from peer and try to send a RX event to VCL, but the fifo's client session index is not initialized yet. So this event will be sent to incorrect session 0. Type: fix Change-Id: I54f222232968bfaea5f4745284a1cfacc89482a9 Signed-off-by: liuyacan --- src/vnet/session/session_api.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index 5910cd366fb..f54a46b39ba 100644 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -303,6 +303,8 @@ mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context, m.server_rx_fifo = fifo_segment_fifo_offset (s->rx_fifo); m.server_tx_fifo = fifo_segment_fifo_offset (s->tx_fifo); m.segment_handle = session_segment_handle (s); + s->rx_fifo->shr->client_session_index = api_context; + s->tx_fifo->shr->client_session_index = api_context; } else { -- cgit 1.2.3-korg