summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/session/application_local.c14
-rw-r--r--src/vnet/tcp/tcp_timer.c2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c
index 3cb743d10e0..064dd6fe77e 100644
--- a/src/vnet/session/application_local.c
+++ b/src/vnet/session/application_local.c
@@ -1350,13 +1350,21 @@ ct_enable_disable (vlib_main_t * vm, u8 is_en)
ct_main_t *cm = &ct_main;
ct_worker_t *wrk;
+ if (is_en == 0)
+ return 0;
+
cm->n_workers = vlib_num_workers ();
cm->fwrk_thread = transport_cl_thread ();
vec_validate (cm->wrk, vtm->n_vlib_mains);
vec_foreach (wrk, cm->wrk)
- clib_spinlock_init (&wrk->pending_connects_lock);
- clib_spinlock_init (&cm->ho_reuseable_lock);
- clib_rwlock_init (&cm->app_segs_lock);
+ {
+ if (wrk->pending_connects_lock == 0)
+ clib_spinlock_init (&wrk->pending_connects_lock);
+ }
+ if (cm->ho_reuseable_lock == 0)
+ clib_spinlock_init (&cm->ho_reuseable_lock);
+ if (cm->app_segs_lock == 0)
+ clib_rwlock_init (&cm->app_segs_lock);
vec_validate (cm->fwrk_pending_connects, cm->n_workers);
return 0;
}
diff --git a/src/vnet/tcp/tcp_timer.c b/src/vnet/tcp/tcp_timer.c
index d98d0d14b17..8ae3f22eaa6 100644
--- a/src/vnet/tcp/tcp_timer.c
+++ b/src/vnet/tcp/tcp_timer.c
@@ -20,6 +20,8 @@ void
tcp_timer_initialize_wheel (tcp_timer_wheel_t * tw,
void (*expired_timer_cb) (u32 *), f64 now)
{
+ if (tw->timers)
+ return;
tw_timer_wheel_init_tcp_twsl (tw, expired_timer_cb, TCP_TIMER_TICK, ~0);
tw->last_run_time = now;
}