cnat: Fix throttle hash & cleanup 55/29955/7
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>
Mon, 16 Nov 2020 17:57:52 +0000 (18:57 +0100)
committerBeno�t Ganne <bganne@cisco.com>
Thu, 28 Jan 2021 13:34:15 +0000 (13:34 +0000)
commit208891c093468b753830d1e7ebdb4a69d4c192bf
tree1e184fd62916e483d2ccee673130ea5890b97ba1
parent5214f3a2c89ed0858e9383dbaefd3202f354610d
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>
src/plugins/cnat/cnat_client.c
src/plugins/cnat/cnat_client.h
src/plugins/cnat/cnat_node.h
src/plugins/cnat/cnat_types.c
src/plugins/cnat/cnat_types.h