aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_sa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipsec/ipsec_sa.c')
-rw-r--r--src/vnet/ipsec/ipsec_sa.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/vnet/ipsec/ipsec_sa.c b/src/vnet/ipsec/ipsec_sa.c
index 633f640ced2..e8a015957ce 100644
--- a/src/vnet/ipsec/ipsec_sa.c
+++ b/src/vnet/ipsec/ipsec_sa.c
@@ -80,14 +80,14 @@ ipsec_sa_stack (ipsec_sa_t * sa)
fib_entry_contribute_forwarding (sa->fib_entry_index, fct, &tmp);
- dpo_stack_from_node ((ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ?
- im->ah6_encrypt_node_index :
- im->ah4_encrypt_node_index),
- &sa->dpo[IPSEC_PROTOCOL_AH], &tmp);
- dpo_stack_from_node ((ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ?
- im->esp6_encrypt_node_index :
- im->esp4_encrypt_node_index),
- &sa->dpo[IPSEC_PROTOCOL_ESP], &tmp);
+ if (IPSEC_PROTOCOL_AH == sa->protocol)
+ dpo_stack_from_node ((ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ?
+ im->ah6_encrypt_node_index :
+ im->ah4_encrypt_node_index), &sa->dpo, &tmp);
+ else
+ dpo_stack_from_node ((ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ?
+ im->esp6_encrypt_node_index :
+ im->esp4_encrypt_node_index), &sa->dpo, &tmp);
dpo_reset (&tmp);
}
@@ -305,8 +305,7 @@ ipsec_sa_del (u32 id)
fib_table_entry_special_remove
(sa->tx_fib_index,
fib_entry_get_prefix (sa->fib_entry_index), FIB_SOURCE_RR);
- dpo_reset (&sa->dpo[IPSEC_PROTOCOL_AH]);
- dpo_reset (&sa->dpo[IPSEC_PROTOCOL_ESP]);
+ dpo_reset (&sa->dpo);
}
vnet_crypto_key_del (vm, sa->crypto_key_index);
vnet_crypto_key_del (vm, sa->integ_key_index);