summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/out2in_ed.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-03-24 12:20:46 +0100
committerOle Trøan <otroan@employees.org>2020-03-25 08:19:39 +0000
commit4cfb0bf1b87d7a89898c20dfb9b145876c08fe02 (patch)
tree098fcb1e9d22ce75dd40ca66d9248649d086681b /src/plugins/nat/out2in_ed.c
parentb1bd8760ce9b1416c8a7f12e411cfcf60de2929f (diff)
nat: fix error counters
Type: fix Change-Id: I021b1427362f4bdba1c0ebc9863c9143dd6b3cb7 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins/nat/out2in_ed.c')
-rw-r--r--src/plugins/nat/out2in_ed.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/nat/out2in_ed.c b/src/plugins/nat/out2in_ed.c
index 420b7b7a863..fbb7d069dbb 100644
--- a/src/plugins/nat/out2in_ed.c
+++ b/src/plugins/nat/out2in_ed.c
@@ -213,6 +213,7 @@ create_session_for_static_mapping_ed (snat_main_t * sm,
u = nat_user_get_or_create (sm, &l_key.addr, l_key.fib_index, thread_index);
if (!u)
{
+ b->error = node->errors[NAT_OUT2IN_ED_ERROR_MAX_SESSIONS_EXCEEDED];
nat_elog_warn ("create NAT user failed");
return 0;
}
@@ -220,6 +221,7 @@ create_session_for_static_mapping_ed (snat_main_t * sm,
s = nat_ed_session_alloc (sm, u, thread_index, now);
if (!s)
{
+ b->error = node->errors[NAT_OUT2IN_ED_ERROR_MAX_USER_SESS_EXCEEDED];
nat44_delete_user_with_no_session (sm, u, thread_index);
nat_elog_warn ("create NAT session failed");
return 0;
@@ -613,6 +615,7 @@ nat44_ed_out2in_unknown_proto (snat_main_t * sm,
thread_index);
if (!u)
{
+ b->error = node->errors[NAT_OUT2IN_ED_ERROR_CANNOT_CREATE_USER];
nat_elog_warn ("create NAT user failed");
return 0;
}
@@ -621,6 +624,7 @@ nat44_ed_out2in_unknown_proto (snat_main_t * sm,
s = nat_ed_session_alloc (sm, u, thread_index, now);
if (!s)
{
+ b->error = node->errors[NAT_OUT2IN_ED_ERROR_MAX_USER_SESS_EXCEEDED];
nat44_delete_user_with_no_session (sm, u, thread_index);
nat_elog_warn ("create NAT session failed");
return 0;
@@ -772,6 +776,7 @@ nat44_ed_out2in_fast_path_node_fn_inline (vlib_main_t * vm,
nat_free_session_data (sm, s0, thread_index, 0);
nat44_delete_session (sm, s0, thread_index);
+ b0->error = node->errors[NAT_OUT2IN_ED_ERROR_SESS_EXPIRED];
next0 = NAT_NEXT_DROP;
goto trace0;
}