aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat
diff options
context:
space:
mode:
authordongjuan <dong.juan1@zte.com.cn>2018-09-11 11:20:30 +0000
committerFlorin Coras <florin.coras@gmail.com>2018-09-19 07:32:36 +0000
commitdf865200c769e31b5fe8f4b246516f07b80f4004 (patch)
treeff6ed90112c7a0a1d6006246854e3b0993351e82 /src/plugins/nat
parent568ebc76b594f8f29bb131b252031d72c055e0b0 (diff)
nat: free port_bitmap
Change-Id: Ied0fc50f1afb0f7fc563784544699726a6d03380 Signed-off-by: dongjuan <dong.juan1@zte.com.cn>
Diffstat (limited to 'src/plugins/nat')
-rwxr-xr-xsrc/plugins/nat/nat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 03e264eda3b..c3583cabc21 100755
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -742,6 +742,7 @@ int snat_add_address (snat_main_t *sm, ip4_address_t *addr, u32 vrf_id,
#define _(N, i, n, s) \
clib_bitmap_alloc (ap->busy_##n##_port_bitmap, 65535); \
ap->busy_##n##_ports = 0; \
+ ap->busy_##n##_ports_per_thread = 0;\
vec_validate_init_empty (ap->busy_##n##_ports_per_thread, tm->n_vlib_mains - 1, 0);
foreach_snat_protocol
#undef _
@@ -1607,6 +1608,12 @@ snat_del_address (snat_main_t *sm, ip4_address_t addr, u8 delete_sm,
}
}
+#define _(N, i, n, s) \
+ clib_bitmap_free (a->busy_##n##_port_bitmap); \
+ vec_free (a->busy_##n##_ports_per_thread);
+ foreach_snat_protocol
+#undef _
+
if (twice_nat)
{
vec_del1 (sm->twice_nat_addresses, i);