dpdk-ipsec: Fix for multipoint IPSEC 01/25801/3
authorNeale Ranns <nranns@cisco.com>
Wed, 11 Mar 2020 14:57:54 +0000 (10:57 -0400)
committerNeale Ranns <nranns@cisco.com>
Fri, 13 Mar 2020 07:20:42 +0000 (07:20 +0000)
Type: fix

fetch the sa_index from the correct location

Change-Id: I351035ee0226c47585995ff9122320fd5c73ec53
Signed-off-by: Neale Ranns <nranns@cisco.com>
src/plugins/dpdk/ipsec/esp_encrypt.c

index 7da5cf8..c024f97 100644 (file)
@@ -24,6 +24,7 @@
 #include <vnet/udp/udp.h>
 #include <dpdk/buffer.h>
 #include <dpdk/ipsec/ipsec.h>
+#include <vnet/ipsec/ipsec_tun.h>
 #include <dpdk/device/dpdk.h>
 #include <dpdk/device/dpdk_priv.h>
 
@@ -217,11 +218,10 @@ dpdk_esp_encrypt_inline (vlib_main_t * vm,
 
          if (is_tun)
            {
-             u32 tmp;
              /* we are on a ipsec tunnel's feature arc */
-             sa_index0 = *(u32 *) vnet_feature_next_with_data (&tmp, b0,
-                                                               sizeof
-                                                               (sa_index0));
+             vnet_buffer (b0)->ipsec.sad_index =
+               sa_index0 = ipsec_tun_protect_get_sa_out
+               (vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
            }
          else
            sa_index0 = vnet_buffer (b0)->ipsec.sad_index;