summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/in2out_ed.c
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-05-07 14:28:56 +0200
committerOle Trøan <otroan@employees.org>2020-05-07 17:04:00 +0000
commit9bb09afb56b1aa787ca574cc732085272059fd5f (patch)
tree38a3051033c5ed864386969f710a07b89c224728 /src/plugins/nat/in2out_ed.c
parent5505ee8904fafc7c1f017f88853f80a616784cf2 (diff)
nat: fix per thread data vlib_main_t usage
Type: fix Change-Id: If6784c9eb278f525e05304d10fd1a00641faaaf0 Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/in2out_ed.c')
-rw-r--r--src/plugins/nat/in2out_ed.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c
index 21ef75c820c..6e44ddb6f76 100644
--- a/src/plugins/nat/in2out_ed.c
+++ b/src/plugins/nat/in2out_ed.c
@@ -170,6 +170,7 @@ icmp_in2out_ed_slow_path (snat_main_t * sm, vlib_buffer_t * b0,
vlib_node_runtime_t * node, u32 next0, f64 now,
u32 thread_index, snat_session_t ** p_s0)
{
+ snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index];
next0 = icmp_in2out (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node,
next0, thread_index, p_s0, 0);
snat_session_t *s0 = *p_s0;
@@ -178,7 +179,7 @@ icmp_in2out_ed_slow_path (snat_main_t * sm, vlib_buffer_t * b0,
/* Accounting */
nat44_session_update_counters (s0, now,
vlib_buffer_length_in_chain
- (sm->vlib_main, b0), thread_index);
+ (tsm->vlib_main, b0), thread_index);
/* Per-user LRU list maintenance */
nat44_session_update_lru (sm, s0, thread_index);
}
@@ -696,7 +697,7 @@ icmp_match_in2out_ed (snat_main_t * sm, vlib_node_runtime_t * node,
next =
slow_path_ed (sm, b, ip->src_address, ip->dst_address, l_port, r_port,
ip->protocol, rx_fib_index, &s, node, next,
- thread_index, vlib_time_now (sm->vlib_main));
+ thread_index, vlib_time_now (tsm->vlib_main));
if (PREDICT_FALSE (next == NAT_NEXT_DROP))
goto out;