From 68ba8807922f252a30991c294757bf818fd93f94 Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Wed, 8 Aug 2018 05:52:47 -0700 Subject: NAT44: delete user with zero sessions (VPP-1282) Change-Id: I756e3ad3de9ffe1494221ef95c1943c8591f8f50 Signed-off-by: Matus Fabian --- src/plugins/nat/out2in.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/nat/out2in.c') diff --git a/src/plugins/nat/out2in.c b/src/plugins/nat/out2in.c index 156b7283fef..774ae67d50a 100755 --- a/src/plugins/nat/out2in.c +++ b/src/plugins/nat/out2in.c @@ -188,6 +188,7 @@ create_session_for_static_mapping (snat_main_t *sm, 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 0; } @@ -1599,6 +1600,7 @@ create_session_for_static_mapping_ed (snat_main_t * sm, 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 0; } @@ -1780,6 +1782,7 @@ create_bypass_for_fwd(snat_main_t * sm, ip4_header_t * ip, u32 rx_fib_index, 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; } @@ -1980,6 +1983,7 @@ nat44_ed_out2in_unknown_proto (snat_main_t *sm, 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 0; } -- cgit 1.2.3-korg