summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2019-06-03 23:36:10 +0000
committerDamjan Marion <dmarion@me.com>2019-06-05 19:03:48 +0000
commit98d6ee7ac305b7c06744d4d30f4da9db0fa076d9 (patch)
tree3da81b24ea494026593c6d073b9a7c408c3ebdab
parent21f265f8011671f0a986a0eb5b565a1c7f90f9e1 (diff)
ipsec: fix combined counters in ah-encrypt node
Type: fix Fixes: 1197449 Change-Id: Icdda3c667ba76542ea3af5d66cc7c3fb10ade1ca Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
-rw-r--r--src/vnet/ipsec/ah_encrypt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c
index f90267ba475..1620f877baa 100644
--- a/src/vnet/ipsec/ah_encrypt.c
+++ b/src/vnet/ipsec/ah_encrypt.c
@@ -169,12 +169,14 @@ ah_encrypt_inline (vlib_main_t * vm,
if (vnet_buffer (b[0])->ipsec.sad_index != current_sa_index)
{
+ if (current_sa_index != ~0)
+ vlib_increment_combined_counter (&ipsec_sa_counters, thread_index,
+ current_sa_index,
+ current_sa_pkts,
+ current_sa_bytes);
current_sa_index = vnet_buffer (b[0])->ipsec.sad_index;
sa0 = pool_elt_at_index (im->sad, current_sa_index);
- vlib_increment_combined_counter (&ipsec_sa_counters, thread_index,
- current_sa_index, current_sa_pkts,
- current_sa_bytes);
current_sa_bytes = current_sa_pkts = 0;
}