summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipsec/ipsec_if.c')
-rw-r--r--src/vnet/ipsec/ipsec_if.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/ipsec/ipsec_if.c b/src/vnet/ipsec/ipsec_if.c
index 9b0eb5b2779..1928e5ac200 100644
--- a/src/vnet/ipsec/ipsec_if.c
+++ b/src/vnet/ipsec/ipsec_if.c
@@ -220,6 +220,8 @@ ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
}
else
{
+ vnet_interface_main_t *vim = &vnm->interface_main;
+
/* check if exists */
if (!p)
return VNET_API_ERROR_INVALID_VALUE;
@@ -229,6 +231,13 @@ ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
vnet_sw_interface_set_flags (vnm, hi->sw_if_index, 0); /* admin down */
vec_add1 (im->free_tunnel_if_indices, t->hw_if_index);
+ vnet_interface_counter_lock (vim);
+ vlib_zero_combined_counter (vim->combined_sw_if_counters +
+ VNET_INTERFACE_COUNTER_TX, hi->sw_if_index);
+ vlib_zero_combined_counter (vim->combined_sw_if_counters +
+ VNET_INTERFACE_COUNTER_RX, hi->sw_if_index);
+ vnet_interface_counter_unlock (vim);
+
/* delete input and output SA */
sa = pool_elt_at_index (im->sad, t->input_sa_index);