summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/lib')
-rw-r--r--src/plugins/nat/lib/ipfix_logging.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/nat/lib/ipfix_logging.c b/src/plugins/nat/lib/ipfix_logging.c
index d4ede6bdd95..38a2cc9931b 100644
--- a/src/plugins/nat/lib/ipfix_logging.c
+++ b/src/plugins/nat/lib/ipfix_logging.c
@@ -1288,12 +1288,12 @@ nat_ipfix_flush_from_main (void)
if (PREDICT_FALSE (!silm->worker_vms))
{
- for (i = 1; i < vec_len (vlib_mains); i++)
- {
- worker_vm = vlib_mains[i];
- if (worker_vm)
- vec_add1 (silm->worker_vms, worker_vm);
- }
+ for (i = 1; i < vlib_get_n_threads (); i++)
+ {
+ worker_vm = vlib_get_main_by_index (i);
+ if (worker_vm)
+ vec_add1 (silm->worker_vms, worker_vm);
+ }
}
/* Trigger flush for each worker thread */