aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ed/nat44_ed.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-03-05 20:34:05 +0100
committerKlement Sekera <ksekera@cisco.com>2021-03-07 23:39:25 +0000
commite3416e307e263dc565546c4e748df99b584708a0 (patch)
treeb80f0f327fee5c9f946ab4f19b5d825e2828b7cc /src/plugins/nat/nat44-ed/nat44_ed.c
parent76401c5767ecdf701f4c77beee0b721c485321d5 (diff)
nat: replace main vlib with per-thread vlib
Fix incorrect vlib main usage. Type: fix Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: Ic5304ca844f1b27756818eb6995b1d9c08412674
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed.c')
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed.c b/src/plugins/nat/nat44-ed/nat44_ed.c
index 0d62e788ec1..c5c2a61f8d5 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed.c
@@ -2405,19 +2405,14 @@ nat_set_outside_address_and_port (snat_address_t *addresses, u32 thread_index,
}
int
-snat_static_mapping_match (snat_main_t * sm,
- ip4_address_t match_addr,
- u16 match_port,
- u32 match_fib_index,
- nat_protocol_t match_protocol,
- ip4_address_t * mapping_addr,
- u16 * mapping_port,
- u32 * mapping_fib_index,
- u8 by_external,
- u8 * is_addr_only,
- twice_nat_type_t * twice_nat,
- lb_nat_type_t * lb, ip4_address_t * ext_host_addr,
- u8 * is_identity_nat, snat_static_mapping_t ** out)
+snat_static_mapping_match (vlib_main_t *vm, snat_main_t *sm,
+ ip4_address_t match_addr, u16 match_port,
+ u32 match_fib_index, nat_protocol_t match_protocol,
+ ip4_address_t *mapping_addr, u16 *mapping_port,
+ u32 *mapping_fib_index, u8 by_external,
+ u8 *is_addr_only, twice_nat_type_t *twice_nat,
+ lb_nat_type_t *lb, ip4_address_t *ext_host_addr,
+ u8 *is_identity_nat, snat_static_mapping_t **out)
{
clib_bihash_kv_8_8_t kv, value;
clib_bihash_8_8_t *mapping_hash;
@@ -2460,11 +2455,9 @@ snat_static_mapping_match (snat_main_t * sm,
{
if (PREDICT_FALSE (lb != 0))
*lb = m->affinity ? AFFINITY_LB_NAT : LB_NAT;
- if (m->affinity && !nat_affinity_find_and_lock (ext_host_addr[0],
- match_addr,
- match_protocol,
- match_port,
- &backend_index))
+ if (m->affinity && !nat_affinity_find_and_lock (
+ vm, ext_host_addr[0], match_addr,
+ match_protocol, match_port, &backend_index))
{
local = pool_elt_at_index (m->locals, backend_index);
*mapping_addr = local->addr;