aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElias Rudberg <elias.rudberg@bahnhof.net>2020-05-27 02:15:53 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-07-15 11:04:47 +0000
commitfa729ec6cd6c7e3ec8cd7b13ede3cc6665587aed (patch)
tree39ca33b515e205c4f2346105e52784f89a413ac9
parentbc69426737b54533992fe763b037f81c912dada1 (diff)
nat: fix regarding vm arg for vlib_time_now call
Change in snat_ipfix_header_create() to use thread-specific vlib_main_t *vm pointer to avoid problems with different threads accessing the same vlib_main_t data structure. This avoids assertion failure when vlib_time_now() is called with a vm corresponding to a different thread. Type: fix Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net> Change-Id: I2096c1debb5688d3b97e5ed9a0ea78d94053d8b7 (cherry picked from commit 5556813fb63d28240a17ccf18f947e60c4cbb263)
-rwxr-xr-xsrc/plugins/nat/nat_ipfix_logging.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/nat/nat_ipfix_logging.c b/src/plugins/nat/nat_ipfix_logging.c
index 764774224a1..59387e19858 100755
--- a/src/plugins/nat/nat_ipfix_logging.c
+++ b/src/plugins/nat/nat_ipfix_logging.c
@@ -493,6 +493,7 @@ snat_ipfix_header_create (flow_report_main_t * frm,
u32 stream_index;
ip4_header_t *ip;
udp_header_t *udp;
+ vlib_main_t *vm = vlib_get_main ();
stream_index = clib_atomic_fetch_or(&silm->stream_index, 0);
stream = &frm->streams[stream_index];
@@ -521,7 +522,7 @@ snat_ipfix_header_create (flow_report_main_t * frm,
h->export_time = clib_host_to_net_u32 ((u32)
(((f64) frm->unix_time_0) +
- (vlib_time_now (frm->vlib_main) -
+ (vlib_time_now (vm) -
frm->vlib_time_0)));
sequence_number = clib_atomic_fetch_add (&stream->sequence_number, 1);