summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2016-10-07 03:29:09 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2016-10-07 11:39:21 +0000
commit025943b9d0629e69343e28a478b3fa2e6d23fa16 (patch)
tree7818b61618e1e174a6d250feee4860b2166a9af3 /vnet
parentf0ccbb02fd48325c3ccab66993b277f95bdbe2c1 (diff)
VPP-464: Fix IPSec-GRE tunnel input with FIB 2.0
Change-Id: Ic29592d39f1d672cb6e7e32b4af6123683e022a7 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/ipsec-gre/interface.c3
-rw-r--r--vnet/vnet/ipsec-gre/ipsec_gre.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/vnet/vnet/ipsec-gre/interface.c b/vnet/vnet/ipsec-gre/interface.c
index dbf9df5628a..fae79b9786e 100644
--- a/vnet/vnet/ipsec-gre/interface.c
+++ b/vnet/vnet/ipsec-gre/interface.c
@@ -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);
diff --git a/vnet/vnet/ipsec-gre/ipsec_gre.c b/vnet/vnet/ipsec-gre/ipsec_gre.c
index cf0f391fede..9fd8a304d5f 100644
--- a/vnet/vnet/ipsec-gre/ipsec_gre.c
+++ b/vnet/vnet/ipsec-gre/ipsec_gre.c
@@ -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;