From 4cfb0bf1b87d7a89898c20dfb9b145876c08fe02 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Tue, 24 Mar 2020 12:20:46 +0100 Subject: nat: fix error counters Type: fix Change-Id: I021b1427362f4bdba1c0ebc9863c9143dd6b3cb7 Signed-off-by: Klement Sekera --- src/plugins/nat/in2out_ed.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins/nat/in2out_ed.c') diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c index ca737d56663..4e7432d8228 100644 --- a/src/plugins/nat/in2out_ed.c +++ b/src/plugins/nat/in2out_ed.c @@ -282,6 +282,7 @@ slow_path_ed (snat_main_t * sm, if (!is_sm) snat_free_outside_address_and_port (sm->addresses, thread_index, &key1); + b->error = node->errors[NAT_IN2OUT_ED_ERROR_CANNOT_CREATE_USER]; return NAT_NEXT_DROP; } @@ -293,6 +294,7 @@ slow_path_ed (snat_main_t * sm, if (!is_sm) snat_free_outside_address_and_port (sm->addresses, thread_index, &key1); + b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_USER_SESS_EXCEEDED]; return NAT_NEXT_DROP; } @@ -712,6 +714,7 @@ nat44_ed_in2out_unknown_proto (snat_main_t * sm, thread_index); if (!u) { + b->error = node->errors[NAT_IN2OUT_ED_ERROR_CANNOT_CREATE_USER]; nat_elog_warn ("create NAT user failed"); return 0; } @@ -780,6 +783,7 @@ nat44_ed_in2out_unknown_proto (snat_main_t * sm, s = nat_ed_session_alloc (sm, u, thread_index, now); if (!s) { + b->error = node->errors[NAT_IN2OUT_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; @@ -959,6 +963,7 @@ nat44_ed_in2out_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_IN2OUT_ED_ERROR_SESS_EXPIRED]; next0 = NAT_NEXT_DROP; goto trace0; } -- cgit 1.2.3-korg