summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-12-13 23:26:56 +0100
committerDave Barach <openvpp@barachs.net>2020-12-14 12:14:21 +0000
commitf0ca1e8d92114582ec9142bd15a40f1eb0102793 (patch)
treeaba56d88d909387605ba7fdaf7fc0fd5d3ff565c /src/plugins/nat
parentb2c31b685fd2cf28436ca32bc93e23eb24c74878 (diff)
misc: refactor clib_bitmap_foreach macro
Type: refactor Change-Id: I077110e1a422722e20aa546a6f3224c06ab0cde5 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/nat')
-rw-r--r--src/plugins/nat/nat.c14
-rw-r--r--src/plugins/nat/nat64/nat64.c6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 0694c348c12..05c7afc2b16 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -1491,10 +1491,10 @@ nat44_add_del_lb_static_mapping (ip4_address_t e_addr, u16 e_port,
if (sm->num_workers > 1)
{
/* *INDENT-OFF* */
- clib_bitmap_foreach (i, bitmap,
- ({
+ clib_bitmap_foreach (i, bitmap)
+ {
vec_add1(m->workers, i);
- }));
+ }
/* *INDENT-ON* */
}
}
@@ -1739,7 +1739,7 @@ nat44_lb_static_mapping_add_del_local (ip4_address_t e_addr, u16 e_port,
if (sm->num_workers > 1)
{
/* *INDENT-OFF* */
- clib_bitmap_foreach (i, bitmap, ({ vec_add1(m->workers, i); }));
+ clib_bitmap_foreach (i, bitmap) { vec_add1(m->workers, i); }
/* *INDENT-ON* */
}
@@ -2467,13 +2467,13 @@ snat_set_workers (uword * bitmap)
vec_free (sm->workers);
/* *INDENT-OFF* */
- clib_bitmap_foreach (i, bitmap,
- ({
+ clib_bitmap_foreach (i, bitmap)
+ {
vec_add1(sm->workers, i);
sm->per_thread_data[sm->first_worker_index + i].snat_thread_index = j;
sm->per_thread_data[sm->first_worker_index + i].thread_index = i;
j++;
- }));
+ }
/* *INDENT-ON* */
sm->port_per_thread = (0xffff - 1024) / _vec_len (sm->workers);
diff --git a/src/plugins/nat/nat64/nat64.c b/src/plugins/nat/nat64/nat64.c
index ae7bb350436..6e5ceecb76f 100644
--- a/src/plugins/nat/nat64/nat64.c
+++ b/src/plugins/nat/nat64/nat64.c
@@ -283,10 +283,10 @@ nat64_init (vlib_main_t * vm)
bitmap = clib_bitmap_set (bitmap, i, 1);
/* *INDENT-OFF* */
- clib_bitmap_foreach (i, bitmap,
- ({
+ clib_bitmap_foreach (i, bitmap)
+ {
vec_add1(nm->workers, i);
- }));
+ }
/* *INDENT-ON* */
clib_bitmap_free (bitmap);