X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fipsec%2Fah_encrypt.c;h=d12ca6704f052a6fe841a9e4601ec37a29e394dd;hb=72f2a3acb797797416a96dc10312ccd431126de7;hp=f90267ba4753cd340cc4fb68323b3889273c084c;hpb=1197449cde8c2b9957ac5963149453689014b148;p=vpp.git diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c index f90267ba475..d12ca6704f0 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; } @@ -292,9 +294,8 @@ ah_encrypt_inline (vlib_main_t * vm, &sa0->ip4_hdr.address_pair, sizeof (ip4_address_t)); - next[0] = sa0->dpo[IPSEC_PROTOCOL_AH].dpoi_next_node; - vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = - sa0->dpo[IPSEC_PROTOCOL_AH].dpoi_index; + next[0] = sa0->dpo.dpoi_next_node; + vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = sa0->dpo.dpoi_index; } else if (is_ip6 && ipsec_sa_is_set_IS_TUNNEL (sa0) && ipsec_sa_is_set_IS_TUNNEL_V6 (sa0)) @@ -302,9 +303,8 @@ ah_encrypt_inline (vlib_main_t * vm, clib_memcpy_fast (&oh6_0->ip6.src_address, &sa0->ip6_hdr.src_address, sizeof (ip6_address_t) * 2); - next[0] = sa0->dpo[IPSEC_PROTOCOL_AH].dpoi_next_node; - vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = - sa0->dpo[IPSEC_PROTOCOL_AH].dpoi_index; + next[0] = sa0->dpo.dpoi_next_node; + vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = sa0->dpo.dpoi_index; } if (PREDICT_TRUE (sa0->integ_op_id))