vcl: fix crash issue when connect an IP that VPP can't resolve 21/38921/2
authorqinyang <[email protected]>
Mon, 29 May 2023 09:12:19 +0000 (02:12 -0700)
committerqinyang <[email protected]>
Mon, 29 May 2023 09:23:09 +0000 (02:23 -0700)
Type: fix

Change-Id: Id0e56906da7cee7be955e87935b073fdd04c78e7
Signed-off-by: qinyang <[email protected]>
src/vcl/vppcom.c

index 3b265d2..94a4961 100644 (file)
@@ -3034,6 +3034,7 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
   u64 session_evt_data = ~0;
   vcl_session_t *s;
   u8 add_event = 0;
+  svm_fifo_t *txf;
 
   switch (e->event_type)
     {
@@ -3099,9 +3100,11 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
       if (!(EPOLLOUT & session_events))
        break;
       /* We didn't have a fifo when the event was added */
-      svm_fifo_add_want_deq_ntf (
-       (vcl_session_is_ct (s) ? s->ct_tx_fifo : s->tx_fifo),
-       SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL);
+      txf = vcl_session_is_ct (s) ? s->ct_tx_fifo : s->tx_fifo;
+      if (txf)
+       {
+         svm_fifo_add_want_deq_ntf (txf, SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL);
+       }
       add_event = 1;
       events[*num_ev].events = EPOLLOUT;
       session_evt_data = s->vep.ev.data.u64;