session: coverity warnings
Change-Id: I53bb1e289ba16ee6d9aed7285b18437c996077a4
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c
index 11528ef..d47b0d9 100644
--- a/src/vnet/session-apps/echo_client.c
+++ b/src/vnet/session-apps/echo_client.c
@@ -49,8 +49,8 @@
int test_buf_len, test_buf_offset, rv;
u32 bytes_this_chunk;
- ASSERT (vec_len (test_data) > 0);
test_buf_len = vec_len (test_data);
+ ASSERT (test_buf_len > 0);
test_buf_offset = s->bytes_sent % test_buf_len;
bytes_this_chunk = clib_min (test_buf_len - test_buf_offset,
s->bytes_to_send);
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c
index 67c42fa..1a41dbd 100755
--- a/src/vnet/session/session_api.c
+++ b/src/vnet/session/session_api.c
@@ -514,12 +514,12 @@
if (!rv)
{
rmp->handle = a->handle;
- rmp->lcl_is_ip4 = tc->is_ip4;
- rmp->lcl_port = tc->lcl_port;
if (app && application_has_global_scope (app))
{
s = listen_session_get_from_handle (a->handle);
tc = listen_session_get_transport (s);
+ rmp->lcl_is_ip4 = tc->is_ip4;
+ rmp->lcl_port = tc->lcl_port;
clib_memcpy (rmp->lcl_ip, &tc->lcl_ip, sizeof(tc->lcl_ip));
if (session_transport_service_type (s) == TRANSPORT_SERVICE_CL)
{