X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fsession.c;h=189c5375fbb8a690d935b94cb88976aa8011a890;hb=b7b929931a07fbb27b43d5cd105f366c3e29807e;hp=23d258ffdea2f1ce54322aee8f1ab838a21e4303;hpb=c5347d9d42866881fa3f267e76bee828dfc9e1bc;p=vpp.git diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 23d258ffdea..189c5375fbb 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -139,7 +139,7 @@ session_alloc (u32 thread_index) pool_get_aligned (session_manager_main.sessions[thread_index], s, CLIB_CACHE_LINE_BYTES); } - memset (s, 0, sizeof (*s)); + clib_memset (s, 0, sizeof (*s)); s->session_index = s - session_manager_main.sessions[thread_index]; s->thread_index = thread_index; return s; @@ -150,7 +150,7 @@ session_free (stream_session_t * s) { pool_put (session_manager_main.sessions[s->thread_index], s); if (CLIB_DEBUG) - memset (s, 0xFA, sizeof (*s)); + clib_memset (s, 0xFA, sizeof (*s)); } void @@ -814,18 +814,22 @@ stream_session_delete_notify (transport_connection_t * tc) * from the app, do the whole disconnect since we might still * have lingering events */ stream_session_disconnect (s); + s->session_state = SESSION_STATE_CLOSED; break; case SESSION_STATE_CLOSING: /* Cleanup lookup table. Transport needs to still be valid */ session_lookup_del_session (s); + s->session_state = SESSION_STATE_CLOSED; break; case SESSION_STATE_CLOSED: case SESSION_STATE_ACCEPTING: stream_session_delete (s); break; + default: + /* Assume connection was not yet added the lookup table */ + session_free_w_fifos (s); + break; } - - s->session_state = SESSION_STATE_CLOSED; } /** @@ -1083,7 +1087,7 @@ stream_session_disconnect (stream_session_t * s) if (vlib_thread_is_main_w_barrier () || thread_index == s->thread_index) { vec_add2 (smm->pending_disconnects[s->thread_index], evt, 1); - memset (evt, 0, sizeof (*evt)); + clib_memset (evt, 0, sizeof (*evt)); evt->session_handle = session_handle (s); evt->event_type = FIFO_EVENT_DISCONNECT; }