aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;