summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-06-05 15:45:50 +0200
committerDamjan Marion <dmarion@me.com>2019-06-05 18:51:11 +0000
commit21f265f8011671f0a986a0eb5b565a1c7f90f9e1 (patch)
treed2df06ef2c22c7563f0f581aa79fbc9107cf5d58 /src
parent867dfdda33cb46887bf5332ade992812bf465918 (diff)
ipsec: fix sa counters in esp-encrypt
Type: fix Fixes: c59b9a2 Change-Id: I6021e67196a4d31ab11d4e3cfbda34b678150701 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ipsec/esp_encrypt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/ipsec/esp_encrypt.c b/src/vnet/ipsec/esp_encrypt.c
index 4d1aa31ea50..ef1f5bbca58 100644
--- a/src/vnet/ipsec/esp_encrypt.c
+++ b/src/vnet/ipsec/esp_encrypt.c
@@ -288,12 +288,15 @@ esp_encrypt_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
if (sa_index0 != current_sa_index)
{
+ if (current_sa_packets)
+ vlib_increment_combined_counter (&ipsec_sa_counters, thread_index,
+ current_sa_index,
+ current_sa_packets,
+ current_sa_bytes);
+ current_sa_packets = current_sa_bytes = 0;
+
sa0 = pool_elt_at_index (im->sad, sa_index0);
current_sa_index = sa_index0;
- vlib_increment_combined_counter (&ipsec_sa_counters, thread_index,
- sa_index0, current_sa_packets,
- current_sa_bytes);
- current_sa_packets = current_sa_bytes = 0;
spi = clib_net_to_host_u32 (sa0->spi);
block_sz = sa0->crypto_block_size;
icv_sz = sa0->integ_icv_size;