tcp: protect against forced cleanups 76/25776/3
authorFlorin Coras <fcoras@cisco.com>
Tue, 10 Mar 2020 19:34:28 +0000 (19:34 +0000)
committerJohn Lo <loj@cisco.com>
Tue, 10 Mar 2020 22:09:21 +0000 (22:09 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0c3b847044d522f55dfd8262afa7c161d5bd5dd3

src/vnet/tcp/tcp.c

index 2ada8b8..7712ade 100644 (file)
@@ -1467,6 +1467,8 @@ tcp_handle_cleanups (tcp_worker_ctx_t * wrk, clib_time_type_t now)
        break;
       clib_fifo_sub2 (wrk->pending_cleanups, req);
       tc = tcp_connection_get (req->connection_index, thread_index);
+      if (PREDICT_FALSE (!tc))
+       continue;
       session_transport_delete_notify (&tc->connection);
       tcp_connection_cleanup (tc);
     }