+ if (PREDICT_TRUE (!is_ip6 && ipsec_sa_is_set_IS_TUNNEL (sa0) &&
+ !ipsec_sa_is_set_IS_TUNNEL_V6 (sa0)))
+ {
+ clib_memcpy_fast (&oh0->ip4.address_pair,
+ &sa0->ip4_hdr.address_pair,
+ sizeof (ip4_address_pair_t));
+
+ 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))
+ {
+ clib_memcpy_fast (&oh6_0->ip6.src_address,
+ &sa0->ip6_hdr.src_address,
+ sizeof (ip6_address_t) * 2);
+ 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))
+ {
+ vnet_crypto_op_t *op;
+ vec_add2_aligned (ptd->integ_ops, op, 1, CLIB_CACHE_LINE_BYTES);
+ vnet_crypto_op_init (op, sa0->integ_op_id);
+ op->src = vlib_buffer_get_current (b[0]);
+ op->len = b[0]->current_length;
+ op->digest = vlib_buffer_get_current (b[0]) + ip_hdr_size +
+ sizeof (ah_header_t);
+ clib_memset (op->digest, 0, icv_size);
+ op->digest_len = icv_size;
+ op->key_index = sa0->integ_key_index;
+ op->user_data = b - bufs;
+ if (ipsec_sa_is_set_USE_ESN (sa0))