VPP-464: Fix IPSec-GRE tunnel input with FIB 2.0 08/3308/2
authorMatus Fabian <matfabia@cisco.com>
Fri, 7 Oct 2016 10:29:09 +0000 (03:29 -0700)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 7 Oct 2016 11:39:21 +0000 (11:39 +0000)
Change-Id: Ic29592d39f1d672cb6e7e32b4af6123683e022a7
Signed-off-by: Matus Fabian <matfabia@cisco.com>
vnet/vnet/ipsec-gre/interface.c
vnet/vnet/ipsec-gre/ipsec_gre.c

index dbf9df5..fae79b9 100644 (file)
@@ -163,6 +163,8 @@ vnet_ipsec_gre_add_del_tunnel (vnet_ipsec_gre_add_del_tunnel_args_t * a,
       t->local_sa = ipsec_get_sa_index_by_sa_id (a->lsa);
       t->remote_sa = ipsec_get_sa_index_by_sa_id (a->rsa);
 
+      ip4_sw_interface_enable_disable (sw_if_index, 1);
+
       vec_validate_init_empty (igm->tunnel_index_by_sw_if_index,
                               sw_if_index, ~0);
       igm->tunnel_index_by_sw_if_index[sw_if_index] = t - igm->tunnels;
@@ -199,6 +201,7 @@ vnet_ipsec_gre_add_del_tunnel (vnet_ipsec_gre_add_del_tunnel_args_t * a,
       t = pool_elt_at_index (igm->tunnels, p[0]);
 
       sw_if_index = t->sw_if_index;
+      ip4_sw_interface_enable_disable (sw_if_index, 0);
       vnet_sw_interface_set_flags (vnm, sw_if_index, 0 /* down */ );
       /* make sure tunnel is removed from l2 bd or xconnect */
       set_int_l2_mode (igm->vlib_main, vnm, MODE_L3, sw_if_index, 0, 0, 0, 0);
index cf0f391..9fd8a30 100644 (file)
@@ -206,6 +206,11 @@ ipsec_gre_interface_tx (vlib_main_t * vm,
          ip0->checksum = ip4_header_checksum (ip0);
          ip1->checksum = ip4_header_checksum (ip1);
 
+         vnet_buffer (b0)->sw_if_index[VLIB_RX] =
+           vnet_buffer (b0)->sw_if_index[VLIB_TX];
+         vnet_buffer (b1)->sw_if_index[VLIB_RX] =
+           vnet_buffer (b1)->sw_if_index[VLIB_TX];
+
          vnet_buffer (b0)->output_features.ipsec_sad_index = t->local_sa;
          vnet_buffer (b1)->output_features.ipsec_sad_index = t->local_sa;
 
@@ -281,6 +286,8 @@ ipsec_gre_interface_tx (vlib_main_t * vm,
          ip0->dst_address.as_u32 = t->tunnel_dst.as_u32;
          ip0->checksum = ip4_header_checksum (ip0);
 
+         vnet_buffer (b0)->sw_if_index[VLIB_RX] =
+           vnet_buffer (b0)->sw_if_index[VLIB_TX];
          vnet_buffer (b0)->output_features.ipsec_sad_index = t->local_sa;
          vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;