summaryrefslogtreecommitdiffstats
path: root/src/tests/vnet/session/tcp_echo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/vnet/session/tcp_echo.c')
-rw-r--r--src/tests/vnet/session/tcp_echo.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/tests/vnet/session/tcp_echo.c b/src/tests/vnet/session/tcp_echo.c
index 6e41e4b2c1a..626ef847e16 100644
--- a/src/tests/vnet/session/tcp_echo.c
+++ b/src/tests/vnet/session/tcp_echo.c
@@ -881,20 +881,16 @@ session_disconnected_handler (session_disconnected_msg_t * mp)
int rv = 0;
p = hash_get (em->session_index_by_vpp_handles, mp->handle);
-
- if (p)
- {
- clib_warning ("disconnected");
- session = pool_elt_at_index (em->sessions, p[0]);
- hash_unset (em->session_index_by_vpp_handles, mp->handle);
- pool_put (em->sessions, session);
- }
- else
+ if (!p)
{
clib_warning ("couldn't find session key %llx", mp->handle);
- rv = -11;
+ return;
}
+ session = pool_elt_at_index (em->sessions, p[0]);
+ hash_unset (em->session_index_by_vpp_handles, mp->handle);
+ pool_put (em->sessions, session);
+
app_alloc_ctrl_evt_to_vpp (session->vpp_evt_q, app_evt,
SESSION_CTRL_EVT_DISCONNECTED_REPLY);
rmp = (session_disconnected_reply_msg_t *) app_evt->evt->data;
@@ -903,8 +899,7 @@ session_disconnected_handler (session_disconnected_msg_t * mp)
rmp->context = mp->context;
app_send_ctrl_evt_to_vpp (session->vpp_evt_q, app_evt);
- if (session)
- session_print_stats (em, session);
+ session_print_stats (em, session);
}
static void