diff options
author | Ole Troan <ot@cisco.com> | 2020-05-08 10:02:18 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-05-08 11:23:18 +0000 |
commit | 71f62a52a2abaeb8b4fc8c70fde501fa7400417c (patch) | |
tree | a7029fc7fe7659d3b5a6d990bb1b83b997b47002 /src/plugins/nat/nat_det_in2out.c | |
parent | 88d6ce2bee53b7c9f876aa78c5db8ab1ea75c08a (diff) |
nat: fix per thread data vlib_main_t usage take 2
The original fix access vlib_main before these was initialized.
Removed cached vlib_mains structure.
Type: fix
Fixes: 9bb09afb56b1aa787ca574cc732085272059fd5f
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I686bab9220e27891f66bf60489c1602855786aa8
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat_det_in2out.c')
-rw-r--r-- | src/plugins/nat/nat_det_in2out.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/nat/nat_det_in2out.c b/src/plugins/nat/nat_det_in2out.c index 762b7b068e6..dc2873ee110 100644 --- a/src/plugins/nat/nat_det_in2out.c +++ b/src/plugins/nat/nat_det_in2out.c @@ -99,7 +99,7 @@ icmp_match_in2out_det (snat_main_t * sm, vlib_node_runtime_t * node, snat_session_key_t * p_value, u8 * p_dont_translate, void *d, void *e) { - snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index]; + vlib_main_t *vm = vlib_get_main (); icmp46_header_t *icmp0; u32 sw_if_index0; u32 rx_fib_index0; @@ -227,7 +227,7 @@ icmp_match_in2out_det (snat_main_t * sm, vlib_node_runtime_t * node, goto out; } - u32 now = (u32) vlib_time_now (tsm->vlib_main); + u32 now = (u32) vlib_time_now (vm); ses0->state = SNAT_SESSION_ICMP_ACTIVE; ses0->expire = now + sm->icmp_timeout; |