summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-07-02 14:52:34 -0700
committerFlorin Coras <fcoras@cisco.com>2020-07-02 14:52:34 -0700
commitfbb846cfa1f95d57159f9ad6cc429f6d9d0b8696 (patch)
tree1cd9371a3701cb0d2a024a7db83d1405d97a5764 /src
parent3e9ff291da7e76bfa2fe6a15a7842edb9933f8b8 (diff)
tcp: fix coverity warning
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I60828bc084b9adbb925c306d26060412c410c516
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp_cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp_cli.c b/src/vnet/tcp/tcp_cli.c
index ada2ac0b4d5..b76b40474a6 100644
--- a/src/vnet/tcp/tcp_cli.c
+++ b/src/vnet/tcp/tcp_cli.c
@@ -907,7 +907,7 @@ tcp_show_half_open (vlib_main_t * vm, u32 start, u32 end, u8 verbose)
int max_index, i;
n_elts = pool_elts (tm->half_open_connections);
- max_index = pool_len (tm->half_open_connections) - 1;
+ max_index = clib_max (pool_len (tm->half_open_connections), 1) - 1;
if (verbose && end == ~0 && n_elts > 50)
{
vlib_cli_output (vm, "Too many connections, use range <start> <end>");
@@ -966,7 +966,7 @@ show_tcp_half_open_fn (vlib_main_t * vm, unformat_input_t * input,
{
if (unformat (line_input, "range %u %u", &start, &end))
;
- else if (unformat (line_input, "verbose %d"), &verbose)
+ else if (unformat (line_input, "verbose %d", &verbose))
;
else if (unformat (line_input, "verbose"))
verbose = 1;