ipsec: multi-arch, next-node-index cleanup
1. specify ipsec_xxx_node.c in MULTIARCH_SOURCES
2. cleanup foreach_ipsec_output_next & foreach_ipsec_input_next,
as next-nodes are actually added by ipsec_register_xx_backend dynamically
thus, ipsec4-input-feature will point to ah4/esp4-encrypt, instead of
pointing to ah6/esp6-encrypt
3. remove an unused count and add counter IPSEC_INPUT_ERROR_RX_MATCH_PKTS
in ipsec-input
Change-Id: Ifcf167812d2cc18187c2cea84b657a52b67e17d4
Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
diff --git a/src/vnet/ipsec/ipsec_if.c b/src/vnet/ipsec/ipsec_if.c
index 357d638..519b613 100644
--- a/src/vnet/ipsec/ipsec_if.c
+++ b/src/vnet/ipsec/ipsec_if.c
@@ -109,7 +109,9 @@
hi0 = vnet_get_sup_hw_interface (vnm, sw_if_index0);
t0 = pool_elt_at_index (im->tunnel_interfaces, hi0->dev_instance);
vnet_buffer (b0)->ipsec.sad_index = t0->output_sa_index;
- next0 = IPSEC_OUTPUT_NEXT_ESP4_ENCRYPT;
+
+ /* 0, tx-node next[0] was added by vlib_node_add_next_with_slot */
+ next0 = 0;
len0 = vlib_buffer_length_in_chain (vm, b0);
@@ -362,12 +364,12 @@
t - im->tunnel_interfaces);
hi = vnet_get_hw_interface (vnm, hw_if_index);
+ /* add esp4 as the next-node-index of this tx-node */
slot = vlib_node_add_next_with_slot
- (vnm->vlib_main, hi->tx_node_index, im->esp4_encrypt_node_index,
- IPSEC_OUTPUT_NEXT_ESP4_ENCRYPT);
+ (vnm->vlib_main, hi->tx_node_index, im->esp4_encrypt_node_index, 0);
- ASSERT (slot == IPSEC_OUTPUT_NEXT_ESP4_ENCRYPT);
+ ASSERT (slot == 0);
t->hw_if_index = hw_if_index;