vcl: fix epoll connected events sid
[vpp.git] / src / vcl / vppcom.c
index a827399..349e27e 100644 (file)
@@ -1988,6 +1988,8 @@ vppcom_session_write_msg (uint32_t session_handle, void *buf, size_t n)
 }
 
 #define vcl_fifo_rx_evt_valid_or_break(_s)                             \
+if (PREDICT_FALSE (!_s->rx_fifo))                                      \
+  break;                                                               \
 if (PREDICT_FALSE (svm_fifo_is_empty (_s->rx_fifo)))                   \
   {                                                                    \
     if (!vcl_session_is_ct (_s))                                       \
@@ -2625,9 +2627,8 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
       break;
     case SESSION_CTRL_EVT_CONNECTED:
       connected_msg = (session_connected_msg_t *) e->data;
-      vcl_session_connected_handler (wrk, connected_msg);
+      sid = vcl_session_connected_handler (wrk, connected_msg);
       /* Generate EPOLLOUT because there's no connected event */
-      sid = vcl_session_index_from_vpp_handle (wrk, connected_msg->handle);
       if (!(session = vcl_session_get (wrk, sid)))
        break;
       session_events = session->vep.ev.events;