aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/esp_encrypt.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-12-16 00:53:11 +0000
committerDamjan Marion <dmarion@me.com>2020-02-21 09:54:19 +0000
commit282872127bbeee6ae59ab3f885c09bad601ee0cc (patch)
tree4f1ef8243b194ca8bf6f1acd62ba4a7d688d371e /src/vnet/ipsec/esp_encrypt.c
parentd057625d499525625d60d2207665eaeb755e380e (diff)
ipsec: IPSec protection for multi-point tunnel interfaces
Type: feature Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Iaba2ab11bfaa1c8db4023434e3043ac39500f938
Diffstat (limited to 'src/vnet/ipsec/esp_encrypt.c')
-rw-r--r--src/vnet/ipsec/esp_encrypt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/vnet/ipsec/esp_encrypt.c b/src/vnet/ipsec/esp_encrypt.c
index 2c4da5dafa8..7df537a5555 100644
--- a/src/vnet/ipsec/esp_encrypt.c
+++ b/src/vnet/ipsec/esp_encrypt.c
@@ -23,6 +23,7 @@
#include <vnet/crypto/crypto.h>
#include <vnet/ipsec/ipsec.h>
+#include <vnet/ipsec/ipsec_tun.h>
#include <vnet/ipsec/esp.h>
#define foreach_esp_encrypt_next \
@@ -319,13 +320,13 @@ esp_encrypt_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
if (is_tun)
{
/* we are on a ipsec tunnel's feature arc */
- u32 next0;
+ u32 next0 = 0;
config_index = b[0]->current_config_index;
- sa_index0 = *(u32 *) vnet_feature_next_with_data (&next0, b[0],
- sizeof
- (sa_index0));
- vnet_buffer (b[0])->ipsec.sad_index = sa_index0;
+ vnet_feature_next (&next0, b[0]);
next[0] = next0;
+ vnet_buffer (b[0])->ipsec.sad_index =
+ sa_index0 = ipsec_tun_protect_get_sa_out
+ (vnet_buffer (b[0])->ip.adj_index[VLIB_TX]);
}
else
sa_index0 = vnet_buffer (b[0])->ipsec.sad_index;