summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat64_db.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-12-19 03:43:07 -0800
committerOle Trøan <otroan@employees.org>2018-01-03 11:44:40 +0000
commita3a6ec63d34c98e19b18530c165d09ac61389225 (patch)
treeb8153ff25070020ec8c6fcef37f8a15b82d7b59a /src/plugins/nat/nat64_db.c
parent041fa507c085010d55d18088321faa64d345bb88 (diff)
NAT64: free port when dynamic BIB deleted (VPP-1107)v18.04-rc0
Change-Id: Id897ed61a26a4069678ed4ddac1ba28bf32809c3 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat64_db.c')
-rw-r--r--src/plugins/nat/nat64_db.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/nat/nat64_db.c b/src/plugins/nat/nat64_db.c
index 97da672a928..7ce28bc6c7f 100644
--- a/src/plugins/nat/nat64_db.c
+++ b/src/plugins/nat/nat64_db.c
@@ -20,7 +20,8 @@
int
nat64_db_init (nat64_db_t * db, u32 bib_buckets, u32 bib_memory_size,
- u32 st_buckets, u32 st_memory_size)
+ u32 st_buckets, u32 st_memory_size,
+ nat64_db_free_addr_port_function_t free_addr_port_cb)
{
clib_bihash_init_24_8 (&db->bib.in2out, "bib-in2out", bib_buckets,
bib_memory_size);
@@ -34,6 +35,7 @@ nat64_db_init (nat64_db_t * db, u32 bib_buckets, u32 bib_memory_size,
clib_bihash_init_48_8 (&db->st.out2in, "st-out2in", st_buckets,
st_memory_size);
+ db->free_addr_port_cb = free_addr_port_cb;
return 0;
}
@@ -160,6 +162,7 @@ nat64_db_bib_entry_free (nat64_db_t * db, nat64_db_bib_entry_t * bibe)
kv.key[2] = bibe_key.as_u64[2];
clib_bihash_add_del_24_8 (&db->bib.out2in, &kv, 0);
+ db->free_addr_port_cb (db, &bibe->out_addr, bibe->out_port, bibe->proto);
/* delete from pool */
pool_put (bib, bibe);