session: fix state check in switch pool 40/34540/1
authorFlorin Coras <fcoras@cisco.com>
Wed, 17 Nov 2021 19:41:10 +0000 (11:41 -0800)
committerFlorin Coras <fcoras@cisco.com>
Wed, 17 Nov 2021 19:41:10 +0000 (11:41 -0800)
This affect udp only

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5e05e9c77b733b9e10c14cc9ef610c9bff216fa0

src/vnet/session/session.c

index a50d3f4..3a7e980 100644 (file)
@@ -999,12 +999,12 @@ session_switch_pool (void *cb_args)
   ASSERT (args->thread_index == vlib_get_thread_index ());
   s = session_get (args->session_index, args->thread_index);
 
+  /* Check if session closed during migration */
+  rargs.is_closed = s->session_state >= SESSION_STATE_TRANSPORT_CLOSING;
+
   transport_cleanup (session_get_transport_proto (s), s->connection_index,
                     s->thread_index);
 
-  /* Check if session closed during migration */
-  rargs.is_closed = s->session_state > SESSION_STATE_READY;
-
   app_wrk = app_worker_get_if_valid (s->app_wrk_index);
   if (app_wrk)
     {