aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat/cnat_types.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2020-11-16 18:57:52 +0100
committerBeno�t Ganne <bganne@cisco.com>2021-01-28 13:34:15 +0000
commit208891c093468b753830d1e7ebdb4a69d4c192bf (patch)
tree1e184fd62916e483d2ccee673130ea5890b97ba1 /src/plugins/cnat/cnat_types.c
parent5214f3a2c89ed0858e9383dbaefd3202f354610d (diff)
cnat: Fix throttle hash & cleanup
Type: fix This fixes two issues : - We used a hash to throttle RPC for adding fib entries, but as we rely on a refcount, we cannot accept loosing an entry, which could happen in case of a collision. - On client cleanup we weren't freeing the fib entry correctly which resulted in crashes when recreating an entry. Added a test that ensures proper cleanup Change-Id: Ie6660b0b02241f75092737410ae2299f8710d6b9 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_types.c')
-rw-r--r--src/plugins/cnat/cnat_types.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/plugins/cnat/cnat_types.c b/src/plugins/cnat/cnat_types.c
index c15c2f61bc9..b6c6628961c 100644
--- a/src/plugins/cnat/cnat_types.c
+++ b/src/plugins/cnat/cnat_types.c
@@ -18,7 +18,6 @@
cnat_main_t cnat_main;
fib_source_t cnat_fib_source;
cnat_timestamp_t *cnat_timestamps;
-throttle_t cnat_throttle;
char *cnat_error_strings[] = {
#define cnat_error(n,s) s,
@@ -144,15 +143,12 @@ format_cnat_endpoint (u8 * s, va_list * args)
static clib_error_t *
cnat_types_init (vlib_main_t * vm)
{
- vlib_thread_main_t *tm = &vlib_thread_main;
- u32 n_vlib_mains = tm->n_vlib_mains;
cnat_fib_source = fib_source_allocate ("cnat",
CNAT_FIB_SOURCE_PRIORITY,
FIB_SOURCE_BH_SIMPLE);
clib_rwlock_init (&cnat_main.ts_lock);
- throttle_init (&cnat_throttle, n_vlib_mains, 1e-3);
return (NULL);
}