aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-08-31 09:45:13 -0700
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-30 00:08:22 +0000
commit2ff21af396b3f22147f439c62a80a5eaeda6cdf1 (patch)
tree78fe2a97b6ceccea5e59fa3be9cae484444073dc /src/vnet/tcp/tcp.c
parent6702641f536ba1a14075b2b24ffd2fb9c6167791 (diff)
session: improve cli
Type: feature Allow session cli filtering based on thread index, transport protocol, session state and range of session pool indices. For instance show session thread 1 proto tcp state ready range 0 20 verbose Shows the session ids for the first 20 tcp sessions in thread 1 that are in ready state. To avoid excessive output that could reasult in the worker barrier being held by the main thread for long periods of time, the session cli will only output: - session ids (verbose == 1) for a maximum of 50 sessions / worker - verbose > 1 details for a maximum of 10 sessions Change-Id: I2cfb351b548e2e0a1d5b4345810be613e2917d17 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 5bb23ecd098eac639641e2b3d62eb8744e0efef0)
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index b898dd5902d..d88fc9730bb 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1167,6 +1167,8 @@ static transport_connection_t *
tcp_session_get_transport (u32 conn_index, u32 thread_index)
{
tcp_connection_t *tc = tcp_connection_get (conn_index, thread_index);
+ if (PREDICT_FALSE (!tc))
+ return 0;
return &tc->connection;
}