X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fin2out.c;h=0fe363383976004316b9716327f2af707fd75c62;hb=ea5b5be4eeb0f4cd80cb466bd6e31cad33c57960;hp=be1ddb3db7e4b334bcb9101cbd3b5ce88d5e1ac2;hpb=067cd6229a47ea3ba8b59a2a04090e80afb5bd2c;p=vpp.git diff --git a/src/plugins/nat/in2out.c b/src/plugins/nat/in2out.c index be1ddb3db7e..0fe36338397 100755 --- a/src/plugins/nat/in2out.c +++ b/src/plugins/nat/in2out.c @@ -258,7 +258,7 @@ snat_not_translate (snat_main_t * sm, vlib_node_runtime_t *node, &value0)) { /* or is static mappings */ - if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0)) + if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0, 0)) return 0; } else @@ -311,6 +311,43 @@ nat_not_translate_output_feature (snat_main_t * sm, ip4_header_t * ip0, return 0; } +int +nat44_i2o_is_idle_session_cb (clib_bihash_kv_8_8_t * kv, void * arg) +{ + snat_main_t *sm = &snat_main; + nat44_is_idle_session_ctx_t *ctx = arg; + snat_session_t *s; + u64 sess_timeout_time; + snat_main_per_thread_data_t *tsm = vec_elt_at_index (sm->per_thread_data, + ctx->thread_index); + clib_bihash_kv_8_8_t s_kv; + + s = pool_elt_at_index (tsm->sessions, kv->value); + sess_timeout_time = s->last_heard + (f64)nat44_session_get_timeout(sm, s); + if (ctx->now >= sess_timeout_time) + { + s_kv.key = s->out2in.as_u64; + if (clib_bihash_add_del_8_8 (&tsm->out2in, &s_kv, 0)) + nat_log_warn ("out2in key del failed"); + + snat_ipfix_logging_nat44_ses_delete(s->in2out.addr.as_u32, + s->out2in.addr.as_u32, + s->in2out.protocol, + s->in2out.port, + s->out2in.port, + s->in2out.fib_index); + + if (!snat_is_session_static (s)) + snat_free_outside_address_and_port (sm->addresses, ctx->thread_index, + &s->out2in); + + nat44_delete_session (sm, s, ctx->thread_index); + return 1; + } + + return 0; +} + static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0, ip4_header_t * ip0, u32 rx_fib_index0, @@ -318,7 +355,8 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0, snat_session_t ** sessionp, vlib_node_runtime_t * node, u32 next0, - u32 thread_index) + u32 thread_index, + f64 now) { snat_user_t *u; snat_session_t *s; @@ -336,6 +374,7 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0, .ip4.as_u32 = ip0->dst_address.as_u32, }, }; + nat44_is_idle_session_ctx_t ctx0; if (PREDICT_FALSE (maximum_sessions_exceeded(sm, thread_index))) { @@ -347,16 +386,8 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0, key1.protocol = key0->protocol; - u = nat_user_get_or_create (sm, &ip0->src_address, rx_fib_index0, - thread_index); - if (!u) - { - nat_log_warn ("create NAT user failed"); - return SNAT_IN2OUT_NEXT_DROP; - } - /* First try to match static mapping by local address and port */ - if (snat_static_mapping_match (sm, *key0, &key1, 0, 0, 0, 0)) + if (snat_static_mapping_match (sm, *key0, &key1, 0, 0, 0, 0, 0)) { /* Try to create dynamic translation */ if (snat_alloc_outside_address_and_port (sm->addresses, rx_fib_index0, @@ -372,9 +403,18 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0, else is_sm = 1; + u = nat_user_get_or_create (sm, &ip0->src_address, rx_fib_index0, + thread_index); + if (!u) + { + nat_log_warn ("create NAT user failed"); + return SNAT_IN2OUT_NEXT_DROP; + } + s = nat_session_alloc_or_recycle (sm, u, thread_index); if (!s) { + nat44_delete_user_with_no_session (sm, u, thread_index); nat_log_warn ("create NAT session failed"); return SNAT_IN2OUT_NEXT_DROP; } @@ -415,17 +455,21 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0, *sessionp = s; /* Add to translation hashes */ + ctx0.now = now; + ctx0.thread_index = thread_index; kv0.key = s->in2out.as_u64; kv0.value = s - sm->per_thread_data[thread_index].sessions; - if (clib_bihash_add_del_8_8 (&sm->per_thread_data[thread_index].in2out, &kv0, - 1 /* is_add */)) + if (clib_bihash_add_or_overwrite_stale_8_8 ( + &sm->per_thread_data[thread_index].in2out, &kv0, + nat44_i2o_is_idle_session_cb, &ctx0)) nat_log_notice ("in2out key add failed"); kv0.key = s->out2in.as_u64; kv0.value = s - sm->per_thread_data[thread_index].sessions; - if (clib_bihash_add_del_8_8 (&sm->per_thread_data[thread_index].out2in, &kv0, - 1 /* is_add */)) + if (clib_bihash_add_or_overwrite_stale_8_8 ( + &sm->per_thread_data[thread_index].out2in, &kv0, + nat44_o2i_is_idle_session_cb, &ctx0)) nat_log_notice ("out2in key add failed"); /* log NAT event */ @@ -557,8 +601,8 @@ u32 icmp_match_in2out_slow(snat_main_t *sm, vlib_node_runtime_t *node, goto out; } - next0 = slow_path (sm, b0, ip0, rx_fib_index0, &key0, - &s0, node, next0, thread_index); + next0 = slow_path (sm, b0, ip0, rx_fib_index0, &key0, &s0, node, next0, + thread_index, vlib_time_now (sm->vlib_main)); if (PREDICT_FALSE (next0 == SNAT_IN2OUT_NEXT_DROP)) goto out; @@ -630,7 +674,7 @@ u32 icmp_match_in2out_fast(snat_main_t *sm, vlib_node_runtime_t *node, } key0.fib_index = rx_fib_index0; - if (snat_static_mapping_match(sm, key0, &sm0, 0, &is_addr_only, 0, 0)) + if (snat_static_mapping_match(sm, key0, &sm0, 0, &is_addr_only, 0, 0, 0)) { if (PREDICT_FALSE(snat_not_translate_fast(sm, node, sw_if_index0, ip0, IP_PROTOCOL_ICMP, rx_fib_index0))) @@ -831,7 +875,7 @@ snat_hairpinning (snat_main_t *sm, kv0.key = key0.as_u64; /* Check if destination is static mappings */ - if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0)) + if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0, 0)) { new_dst_addr0 = sm0.addr.as_u32; new_dst_port0 = sm0.port; @@ -962,7 +1006,7 @@ snat_icmp_hairpinning (snat_main_t *sm, if (rv) { /* or static mappings */ - if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0)) + if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0, 0)) { new_dst_addr0 = sm0.addr.as_u32; vnet_buffer(b0)->sw_if_index[VLIB_TX] = sm0.fib_index; @@ -1251,7 +1295,7 @@ snat_in2out_node_fn_inline (vlib_main_t * vm, } next0 = slow_path (sm, b0, ip0, rx_fib_index0, &key0, - &s0, node, next0, thread_index); + &s0, node, next0, thread_index, now); if (PREDICT_FALSE (next0 == SNAT_IN2OUT_NEXT_DROP)) goto trace00; } @@ -1411,7 +1455,7 @@ snat_in2out_node_fn_inline (vlib_main_t * vm, } next1 = slow_path (sm, b1, ip1, rx_fib_index1, &key1, - &s1, node, next1, thread_index); + &s1, node, next1, thread_index, now); if (PREDICT_FALSE (next1 == SNAT_IN2OUT_NEXT_DROP)) goto trace01; } @@ -1607,7 +1651,7 @@ snat_in2out_node_fn_inline (vlib_main_t * vm, } next0 = slow_path (sm, b0, ip0, rx_fib_index0, &key0, - &s0, node, next0, thread_index); + &s0, node, next0, thread_index, now); if (PREDICT_FALSE (next0 == SNAT_IN2OUT_NEXT_DROP)) goto trace0; @@ -1987,7 +2031,7 @@ nat44_reass_hairpinning (snat_main_t *sm, udp0 = ip4_next_header (ip0); /* Check if destination is static mappings */ - if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0)) + if (!snat_static_mapping_match(sm, key0, &sm0, 1, 0, 0, 0, 0)) { new_dst_addr0 = sm0.addr.as_u32; new_dst_port0 = sm0.port; @@ -2155,7 +2199,7 @@ nat44_in2out_reass_node_fn (vlib_main_t * vm, goto trace0; next0 = slow_path (sm, b0, ip0, rx_fib_index0, &key0, - &s0, node, next0, thread_index); + &s0, node, next0, thread_index, now); if (PREDICT_FALSE (next0 == SNAT_IN2OUT_NEXT_DROP)) goto trace0; @@ -2373,6 +2417,110 @@ icmp_get_ed_key(ip4_header_t *ip0, nat_ed_ses_key_t *p_key0) return 0; } +int +nat44_i2o_ed_is_idle_session_cb (clib_bihash_kv_16_8_t * kv, void * arg) +{ + snat_main_t *sm = &snat_main; + nat44_is_idle_session_ctx_t *ctx = arg; + snat_session_t *s; + u64 sess_timeout_time; + nat_ed_ses_key_t ed_key; + clib_bihash_kv_16_8_t ed_kv; + int i; + snat_address_t *a; + snat_session_key_t key; + snat_main_per_thread_data_t *tsm = vec_elt_at_index (sm->per_thread_data, + ctx->thread_index); + + s = pool_elt_at_index (tsm->sessions, kv->value); + sess_timeout_time = s->last_heard + (f64)nat44_session_get_timeout(sm, s); + if (ctx->now >= sess_timeout_time) + { + if (is_fwd_bypass_session (s)) + goto delete; + + ed_key.l_addr = s->out2in.addr; + ed_key.r_addr = s->ext_host_addr; + ed_key.fib_index = s->out2in.fib_index; + if (snat_is_unk_proto_session (s)) + { + ed_key.proto = s->in2out.port; + ed_key.r_port = 0; + ed_key.l_port = 0; + } + else + { + ed_key.proto = snat_proto_to_ip_proto (s->in2out.protocol); + ed_key.l_port = s->out2in.port; + ed_key.r_port = s->ext_host_port; + } + ed_kv.key[0] = ed_key.as_u64[0]; + ed_kv.key[1] = ed_key.as_u64[1]; + if (clib_bihash_add_del_16_8 (&tsm->out2in_ed, &ed_kv, 0)) + nat_log_warn ("out2in_ed key del failed"); + + if (snat_is_unk_proto_session (s)) + goto delete; + + snat_ipfix_logging_nat44_ses_delete(s->in2out.addr.as_u32, + s->out2in.addr.as_u32, + s->in2out.protocol, + s->in2out.port, + s->out2in.port, + s->in2out.fib_index); + + if (is_twice_nat_session (s)) + { + for (i = 0; i < vec_len (sm->twice_nat_addresses); i++) + { + key.protocol = s->in2out.protocol; + key.port = s->ext_host_nat_port; + a = sm->twice_nat_addresses + i; + if (a->addr.as_u32 == s->ext_host_nat_addr.as_u32) + { + snat_free_outside_address_and_port (sm->twice_nat_addresses, + ctx->thread_index, &key); + break; + } + } + } + + if (snat_is_session_static (s)) + goto delete; + + if (s->outside_address_index != ~0) + snat_free_outside_address_and_port (sm->addresses, ctx->thread_index, + &s->out2in); + delete: + nat44_delete_session (sm, s, ctx->thread_index); + return 1; + } + + return 0; +} + +static inline u32 +icmp_in2out_ed_slow_path (snat_main_t * sm, vlib_buffer_t * b0, + ip4_header_t * ip0, icmp46_header_t * icmp0, + u32 sw_if_index0, u32 rx_fib_index0, + vlib_node_runtime_t * node, u32 next0, f64 now, + u32 thread_index, snat_session_t ** p_s0) +{ + 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; + if (PREDICT_TRUE(next0 != SNAT_IN2OUT_NEXT_DROP && s0)) + { + /* Hairpinning */ + if (vnet_buffer(b0)->sw_if_index[VLIB_TX] == ~0) + snat_icmp_hairpinning(sm, b0, ip0, icmp0, sm->endpoint_dependent); + /* Accounting */ + nat44_session_update_counters (s0, now, + vlib_buffer_length_in_chain (sm->vlib_main, b0)); + } + return next0; +} + static u32 slow_path_ed (snat_main_t *sm, vlib_buffer_t *b, @@ -2381,12 +2529,13 @@ slow_path_ed (snat_main_t *sm, snat_session_t ** sessionp, vlib_node_runtime_t * node, u32 next, - u32 thread_index) + u32 thread_index, + f64 now) { snat_session_t *s; snat_user_t *u; snat_session_key_t key0, key1; - u8 lb = 0, is_sm = 0; + lb_nat_type_t lb = 0, is_sm = 0; u32 address_index = ~0; snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index]; nat_ed_ses_key_t *key = (nat_ed_ses_key_t *) kv->key; @@ -2400,6 +2549,7 @@ slow_path_ed (snat_main_t *sm, .ip4.as_u32 = key->r_addr.as_u32, }, }; + nat44_is_idle_session_ctx_t ctx; if (PREDICT_FALSE (maximum_sessions_exceeded (sm, thread_index))) { @@ -2415,7 +2565,7 @@ slow_path_ed (snat_main_t *sm, key0.fib_index = rx_fib_index; key1.fib_index = sm->outside_fib_index; /* First try to match static mapping by local address and port */ - if (snat_static_mapping_match (sm, key0, &key1, 0, 0, 0, &lb)) + if (snat_static_mapping_match (sm, key0, &key1, 0, 0, 0, &lb, 0)) { /* Try to create dynamic translation */ if (snat_alloc_outside_address_and_port (sm->addresses, rx_fib_index, @@ -2436,13 +2586,20 @@ slow_path_ed (snat_main_t *sm, if (!u) { nat_log_warn ("create NAT user failed"); + if (!is_sm) + snat_free_outside_address_and_port (sm->addresses, + thread_index, &key1); return SNAT_IN2OUT_NEXT_DROP; } - s = nat_session_alloc_or_recycle (sm, u, thread_index); + s = nat_ed_session_alloc (sm, u, thread_index); if (!s) { + nat44_delete_user_with_no_session (sm, u, thread_index); nat_log_warn ("create NAT session failed"); + if (!is_sm) + snat_free_outside_address_and_port (sm->addresses, + thread_index, &key1); return SNAT_IN2OUT_NEXT_DROP; } @@ -2485,13 +2642,19 @@ slow_path_ed (snat_main_t *sm, /* Add to lookup tables */ kv->value = s - tsm->sessions; - if (clib_bihash_add_del_16_8 (&tsm->in2out_ed, kv, 1)) + ctx.now = now; + ctx.thread_index = thread_index; + if (clib_bihash_add_or_overwrite_stale_16_8 (&tsm->in2out_ed, kv, + nat44_i2o_ed_is_idle_session_cb, + &ctx)) nat_log_notice ("in2out-ed key add failed"); make_ed_kv (kv, &key1.addr, &key->r_addr, key->proto, s->out2in.fib_index, key1.port, key->r_port); kv->value = s - tsm->sessions; - if (clib_bihash_add_del_16_8 (&tsm->out2in_ed, kv, 1)) + if (clib_bihash_add_or_overwrite_stale_16_8 (&tsm->out2in_ed, kv, + nat44_o2i_ed_is_idle_session_cb, + &ctx)) nat_log_notice ("out2in-ed key add failed"); *sessionp = s; @@ -2528,7 +2691,7 @@ nat44_ed_not_translate (snat_main_t * sm, vlib_node_runtime_t *node, key0.protocol = proto; key0.fib_index = sm->outside_fib_index; /* or is static mappings */ - if (!snat_static_mapping_match(sm, key0, &key1, 1, 0, 0, 0)) + if (!snat_static_mapping_match(sm, key0, &key1, 1, 0, 0, 0, 0)) return 0; } else @@ -2586,8 +2749,6 @@ nat_not_translate_output_feature_fwd (snat_main_t * sm, ip4_header_t * ip, if (nat44_set_tcp_session_state_i2o (sm, s, tcp, thread_index)) return 1; } - /* Per-user LRU list maintenance */ - nat44_session_update_lru (sm, s, thread_index); /* Accounting */ nat44_session_update_counters (s, now, vlib_buffer_length_in_chain (vm, b)); @@ -2603,22 +2764,24 @@ nat_not_translate_output_feature_fwd (snat_main_t * sm, ip4_header_t * ip, static_always_inline int nat44_ed_not_translate_output_feature (snat_main_t * sm, ip4_header_t * ip, u8 proto, u16 src_port, u16 dst_port, - u32 thread_index, u32 sw_if_index) + u32 thread_index, u32 rx_sw_if_index, + u32 tx_sw_if_index) { clib_bihash_kv_16_8_t kv, value; snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index]; snat_interface_t *i; snat_session_t *s; - u32 fib_index = ip4_fib_table_get_index_for_sw_if_index (sw_if_index); + u32 rx_fib_index = ip4_fib_table_get_index_for_sw_if_index (rx_sw_if_index); + u32 tx_fib_index = ip4_fib_table_get_index_for_sw_if_index (tx_sw_if_index); /* src NAT check */ - make_ed_kv (&kv, &ip->src_address, &ip->dst_address, proto, fib_index, + make_ed_kv (&kv, &ip->src_address, &ip->dst_address, proto, tx_fib_index, src_port, dst_port); if (!clib_bihash_search_16_8 (&tsm->out2in_ed, &kv, &value)) return 1; /* dst NAT check */ - make_ed_kv (&kv, &ip->dst_address, &ip->src_address, proto, fib_index, + make_ed_kv (&kv, &ip->dst_address, &ip->src_address, proto, rx_fib_index, dst_port, src_port); if (!clib_bihash_search_16_8 (&tsm->in2out_ed, &kv, &value)) { @@ -2629,7 +2792,7 @@ nat44_ed_not_translate_output_feature (snat_main_t * sm, ip4_header_t * ip, /* hairpinning */ pool_foreach (i, sm->output_feature_interfaces, ({ - if ((nat_interface_is_inside(i)) && (sw_if_index == i->sw_if_index)) + if ((nat_interface_is_inside(i)) && (rx_sw_if_index == i->sw_if_index)) return 0; })); return 1; @@ -2677,7 +2840,8 @@ icmp_match_in2out_ed(snat_main_t *sm, vlib_node_runtime_t *node, if (vnet_buffer(b)->sw_if_index[VLIB_TX] != ~0) { if (PREDICT_FALSE(nat44_ed_not_translate_output_feature(sm, ip, - key.proto, key.l_port, key.r_port, thread_index, sw_if_index))) + key.proto, key.l_port, key.r_port, thread_index, sw_if_index, + vnet_buffer(b)->sw_if_index[VLIB_TX]))) { dont_translate = 1; goto out; @@ -2701,7 +2865,7 @@ icmp_match_in2out_ed(snat_main_t *sm, vlib_node_runtime_t *node, } next = slow_path_ed (sm, b, rx_fib_index, &kv, &s, node, next, - thread_index); + thread_index, vlib_time_now (sm->vlib_main)); if (PREDICT_FALSE (next == SNAT_IN2OUT_NEXT_DROP)) goto out; @@ -2921,9 +3085,10 @@ nat44_ed_in2out_unknown_proto (snat_main_t *sm, } create_ses: - s = nat_session_alloc_or_recycle (sm, u, thread_index); + s = nat_ed_session_alloc (sm, u, thread_index); if (!s) { + nat44_delete_user_with_no_session (sm, u, thread_index); nat_log_warn ("create NAT session failed"); return 0; } @@ -2962,8 +3127,6 @@ create_ses: /* Accounting */ nat44_session_update_counters (s, now, vlib_buffer_length_in_chain (vm, b)); - /* Per-user LRU list maintenance */ - nat44_session_update_lru (sm, s, thread_index); /* Hairpinning */ if (vnet_buffer(b)->sw_if_index[VLIB_TX] == ~0) @@ -3085,7 +3248,7 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, if (PREDICT_FALSE (proto0 == SNAT_PROTOCOL_ICMP)) { - next0 = icmp_in2out_slow_path + next0 = icmp_in2out_ed_slow_path (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node, next0, now, thread_index, &s0); goto trace00; @@ -3125,7 +3288,8 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, { if (PREDICT_FALSE(nat44_ed_not_translate_output_feature( sm, ip0, ip0->protocol, udp0->src_port, - udp0->dst_port, thread_index, sw_if_index0))) + udp0->dst_port, thread_index, sw_if_index0, + vnet_buffer(b0)->sw_if_index[VLIB_TX]))) goto trace00; } else @@ -3137,7 +3301,7 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, } next0 = slow_path_ed (sm, b0, rx_fib_index0, &kv0, &s0, node, - next0, thread_index); + next0, thread_index, now); if (PREDICT_FALSE (next0 == SNAT_IN2OUT_NEXT_DROP)) goto trace00; @@ -3208,8 +3372,6 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, /* Accounting */ nat44_session_update_counters (s0, now, vlib_buffer_length_in_chain (vm, b0)); - /* Per-user LRU list maintenance */ - nat44_session_update_lru (sm, s0, thread_index); trace00: if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE) @@ -3270,7 +3432,7 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, if (PREDICT_FALSE (proto1 == SNAT_PROTOCOL_ICMP)) { - next1 = icmp_in2out_slow_path + next1 = icmp_in2out_ed_slow_path (sm, b1, ip1, icmp1, sw_if_index1, rx_fib_index1, node, next1, now, thread_index, &s1); goto trace01; @@ -3310,7 +3472,8 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, { if (PREDICT_FALSE(nat44_ed_not_translate_output_feature( sm, ip1, ip1->protocol, udp1->src_port, - udp1->dst_port, thread_index, sw_if_index1))) + udp1->dst_port, thread_index, sw_if_index1, + vnet_buffer(b1)->sw_if_index[VLIB_TX]))) goto trace01; } else @@ -3322,7 +3485,7 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, } next1 = slow_path_ed (sm, b1, rx_fib_index1, &kv1, &s1, node, - next1, thread_index); + next1, thread_index, now); if (PREDICT_FALSE (next1 == SNAT_IN2OUT_NEXT_DROP)) goto trace01; @@ -3393,8 +3556,6 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, /* Accounting */ nat44_session_update_counters (s1, now, vlib_buffer_length_in_chain (vm, b1)); - /* Per-user LRU list maintenance */ - nat44_session_update_lru (sm, s1, thread_index); trace01: if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE) @@ -3484,7 +3645,7 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, if (PREDICT_FALSE (proto0 == SNAT_PROTOCOL_ICMP)) { - next0 = icmp_in2out_slow_path + next0 = icmp_in2out_ed_slow_path (sm, b0, ip0, icmp0, sw_if_index0, rx_fib_index0, node, next0, now, thread_index, &s0); goto trace0; @@ -3524,7 +3685,8 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, { if (PREDICT_FALSE(nat44_ed_not_translate_output_feature( sm, ip0, ip0->protocol, udp0->src_port, - udp0->dst_port, thread_index, sw_if_index0))) + udp0->dst_port, thread_index, sw_if_index0, + vnet_buffer(b0)->sw_if_index[VLIB_TX]))) goto trace0; } else @@ -3536,7 +3698,7 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, } next0 = slow_path_ed (sm, b0, rx_fib_index0, &kv0, &s0, node, - next0, thread_index); + next0, thread_index, now); if (PREDICT_FALSE (next0 == SNAT_IN2OUT_NEXT_DROP)) goto trace0; @@ -3607,8 +3769,6 @@ nat44_ed_in2out_node_fn_inline (vlib_main_t * vm, /* Accounting */ nat44_session_update_counters (s0, now, vlib_buffer_length_in_chain (vm, b0)); - /* Per-user LRU list maintenance */ - nat44_session_update_lru (sm, s0, thread_index); trace0: if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE) @@ -5161,7 +5321,7 @@ snat_in2out_fast_static_map_fn (vlib_main_t * vm, key0.port = udp0->src_port; key0.fib_index = rx_fib_index0; - if (snat_static_mapping_match(sm, key0, &sm0, 0, 0, 0, 0)) + if (snat_static_mapping_match(sm, key0, &sm0, 0, 0, 0, 0, 0)) { b0->error = node->errors[SNAT_IN2OUT_ERROR_NO_TRANSLATION]; next0= SNAT_IN2OUT_NEXT_DROP;