From 776f3d85ebd4edfb70b0f748890f1efd98d8474c Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 2 Nov 2018 08:23:58 -0700 Subject: tcp: coverity fixes Change-Id: Ib15d629c5fde7849bfa3307f42659e920eb0f463 Signed-off-by: Florin Coras --- src/vnet/tcp/tcp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/vnet/tcp/tcp.c') diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index ba427b76b1a..1fb95b3ad3a 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -1798,6 +1798,12 @@ tcp_scoreboard_replay (u8 * s, tcp_connection_t * tc, u8 verbose) tcp_connection_t _dummy_tc, *dummy_tc = &_dummy_tc; sack_block_t *block; + if (!TCP_SCOREBOARD_TRACE) + { + s = format (s, "scoreboard tracing not enabled"); + return s; + } + if (!tc) return s; @@ -1806,13 +1812,7 @@ tcp_scoreboard_replay (u8 * s, tcp_connection_t * tc, u8 verbose) scoreboard_init (&dummy_tc->sack_sb); dummy_tc->rcv_opts.flags |= TCP_OPTS_FLAG_SACK; -/* Since this is also accessible via decl. in tcp.h. - * Otherwise, it is gated earlier by cli parser. - */ -#if (!TCP_SCOREBOARD_TRACE) - s = format (0, "scoreboard tracing not enabled"); - return s; -#else +#if TCP_SCOREBOARD_TRACE trace = tc->sack_sb.trace; trace_len = vec_len (tc->sack_sb.trace); #endif -- cgit 1.2.3-korg