diff options
author | Florin Coras <fcoras@cisco.com> | 2018-07-17 05:35:47 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-07-19 21:15:28 +0000 |
commit | 3d0fadc01fa92664b8ebc5d8400b6344ee7e92df (patch) | |
tree | 283618c3fb801af48e0dd68680c9a5d13b4ae10d /src/vnet/session | |
parent | 970a0b87bb7d7d9c16acbe9ea207a7d4c81bfaee (diff) |
session: coverity warnings
Change-Id: I4505954c737e8c6a3d4177c6833f2b12099e6dd4
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/session_node.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index bf0c3959471..1ae92edf1ea 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -112,22 +112,24 @@ session_mq_disconnected_handler (void *data) svm_msg_q_msg_t _msg, *msg = &_msg; session_disconnected_msg_t *mp; session_event_t *evt; + stream_session_t *s; application_t *app; int rv = 0; mp = (session_disconnected_msg_t *) data; app = application_lookup (mp->client_index); - if (app) + s = session_get_from_handle_if_valid (mp->handle); + if (!(app && s && s->app_index == app->index)) { - a->handle = mp->handle; - a->app_index = app->index; - rv = vnet_disconnect_session (a); - } - else - { - rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED; + clib_warning ("could not disconnect session: %llu app: %u", mp->handle, + mp->client_index); + return; } + a->handle = mp->handle; + a->app_index = app->index; + rv = vnet_disconnect_session (a); + svm_msg_q_lock_and_alloc_msg_w_ring (app->event_queue, SESSION_MQ_CTRL_EVT_RING, SVM_Q_WAIT, msg); |