- pool_get (wrk->connections, tc);
- clib_memcpy_fast (tc, base, sizeof (*tc));
+ /* Make sure connection is still valid if pool moves */
+ if ((*base)->c_thread_index == thread_index)
+ {
+ u32 base_index = (*base)->c_c_index;
+ pool_get (wrk->connections, tc);
+ *base = tcp_connection_get (base_index, thread_index);
+ }
+ else
+ {
+ pool_get (wrk->connections, tc);
+ }
+ clib_memcpy_fast (tc, *base, sizeof (*tc));