aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/in2out_ed.c
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-04-06 12:52:33 +0200
committerFilip Varga <fivarga@cisco.com>2020-04-16 14:05:46 +0200
commit1a0a89770688a37e500f634b68805b1984eccac0 (patch)
treec6112c2210b3f9d6ebbe5fd5d20212440394e290 /src/plugins/nat/in2out_ed.c
parent8daeea9a5dc2c68c8e54fe7bdae98cec7072a9cd (diff)
nat: scavenging functionality removed
Type: refactor Change-Id: I9f743ba2818e1b1c5004c3575925cc7b479948d8 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.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c
index 807a716e942..a70369aae4e 100644
--- a/src/plugins/nat/in2out_ed.c
+++ b/src/plugins/nat/in2out_ed.c
@@ -309,18 +309,12 @@ slow_path_ed (snat_main_t * sm,
};
nat44_is_idle_session_ctx_t ctx;
- u32 cleared = 0;
-
if (PREDICT_FALSE (nat44_maximum_sessions_exceeded (sm, thread_index)))
{
- if (PREDICT_FALSE
- (!(cleared = nat44_users_cleanup (thread_index, now))))
- {
- b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_SESSIONS_EXCEEDED];
- nat_ipfix_logging_max_sessions (thread_index, sm->max_translations);
- nat_elog_notice ("maximum sessions exceeded");
- return NAT_NEXT_DROP;
- }
+ b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_SESSIONS_EXCEEDED];
+ nat_ipfix_logging_max_sessions (thread_index, sm->max_translations);
+ nat_elog_notice ("maximum sessions exceeded");
+ return NAT_NEXT_DROP;
}
key0.addr = key->l_addr;
@@ -339,16 +333,9 @@ slow_path_ed (snat_main_t * sm,
sm->port_per_thread,
tsm->snat_thread_index))
{
- if (cleared || !nat44_out_of_ports_cleanup (thread_index, now) ||
- nat_alloc_addr_and_port_ed (sm->addresses, rx_fib_index,
- thread_index, key, &key1,
- sm->port_per_thread,
- tsm->snat_thread_index))
- {
- nat_elog_notice ("addresses exhausted");
- b->error = node->errors[NAT_IN2OUT_ED_ERROR_OUT_OF_PORTS];
- return NAT_NEXT_DROP;
- }
+ nat_elog_notice ("addresses exhausted");
+ b->error = node->errors[NAT_IN2OUT_ED_ERROR_OUT_OF_PORTS];
+ return NAT_NEXT_DROP;
}
}
else