aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ed/nat44_ed_out2in.c
diff options
context:
space:
mode:
authorKlement Sekera <klement@graphiant.com>2022-02-18 15:11:14 +0000
committerNeale Ranns <neale@graphiant.com>2022-02-21 08:29:00 +0000
commitcaf4e754ea635b0ed028e9e8ecba29b32ff4a8a7 (patch)
tree8704f9ef483e244b60563136ce6a433d5a0ca195 /src/plugins/nat/nat44-ed/nat44_ed_out2in.c
parenta19ad1c362f90de50fe459a859a5041d97f5079d (diff)
nat: make tcp/udp/icmp packet counters consistent
TCP/UDP packets which are dropped are not counted towards TCP/UDP counters. Apply same behaviour to ICMP packets. Type: improvement Signed-off-by: Klement Sekera <klement.sekera@gmail.com> Change-Id: I487fa7135ac8e49431a621fac213638d2dab31c8
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed_out2in.c')
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed_out2in.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_out2in.c b/src/plugins/nat/nat44-ed/nat44_ed_out2in.c
index 40a72122140..aa0cc508f08 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed_out2in.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed_out2in.c
@@ -1135,8 +1135,12 @@ nat44_ed_out2in_slow_path_node_fn_inline (vlib_main_t * vm,
goto trace0;
}
- vlib_increment_simple_counter (&sm->counters.slowpath.out2in.icmp,
- thread_index, sw_if_index0, 1);
+ if (NAT_NEXT_DROP != next[0])
+ {
+ vlib_increment_simple_counter (
+ &sm->counters.slowpath.out2in.icmp, thread_index, sw_if_index0,
+ 1);
+ }
goto trace0;
}