aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_if.c
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2017-05-14 21:47:18 -0500
committerNeale Ranns <nranns@cisco.com>2017-05-15 20:49:05 +0000
commite04d09de8433213f3c3e8cdc5acaa7e2289d92de (patch)
tree17e444800a9fb647d1a5490e6d5cd84da86b1051 /src/vnet/ipsec/ipsec_if.c
parent5c85f358bb08403d9edce14d9cc63675bda6799d (diff)
Add sw_if_index of tunnel interface to API reply for ipsec_tunnel_if_add_del
Change-Id: If5158f6fa7344dee94548c93dace779430e0647f Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_if.c')
-rw-r--r--src/vnet/ipsec/ipsec_if.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/vnet/ipsec/ipsec_if.c b/src/vnet/ipsec/ipsec_if.c
index ed1248942e3..9b0eb5b2779 100644
--- a/src/vnet/ipsec/ipsec_if.c
+++ b/src/vnet/ipsec/ipsec_if.c
@@ -92,16 +92,12 @@ VNET_HW_INTERFACE_CLASS (ipsec_hw_class) =
/* *INDENT-ON* */
static int
-ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
- ipsec_add_del_tunnel_args_t * args);
-
-static int
ipsec_add_del_tunnel_if_rpc_callback (ipsec_add_del_tunnel_args_t * a)
{
vnet_main_t *vnm = vnet_get_main ();
ASSERT (vlib_get_thread_index () == 0);
- return ipsec_add_del_tunnel_if_internal (vnm, a);
+ return ipsec_add_del_tunnel_if_internal (vnm, a, NULL);
}
int
@@ -114,11 +110,12 @@ ipsec_add_del_tunnel_if (ipsec_add_del_tunnel_args_t * args)
int
ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
- ipsec_add_del_tunnel_args_t * args)
+ ipsec_add_del_tunnel_args_t * args,
+ u32 * sw_if_index)
{
ipsec_tunnel_if_t *t;
ipsec_main_t *im = &ipsec_main;
- vnet_hw_interface_t *hi;
+ vnet_hw_interface_t *hi = NULL;
u32 hw_if_index = ~0;
uword *p;
ipsec_sa_t *sa;
@@ -209,10 +206,10 @@ ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
t - im->tunnel_interfaces,
ipsec_hw_class.index,
t - im->tunnel_interfaces);
-
- hi = vnet_get_hw_interface (vnm, hw_if_index);
- hi->output_node_index = ipsec_if_output_node.index;
}
+
+ hi = vnet_get_hw_interface (vnm, hw_if_index);
+ hi->output_node_index = ipsec_if_output_node.index;
t->hw_if_index = hw_if_index;
/*1st interface, register protocol */
@@ -220,7 +217,6 @@ ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
ip4_register_protocol (IP_PROTOCOL_IPSEC_ESP,
ipsec_if_input_node.index);
- return hw_if_index;
}
else
{
@@ -253,6 +249,10 @@ ipsec_add_del_tunnel_if_internal (vnet_main_t * vnm,
hash_unset (im->ipsec_if_pool_index_by_key, key);
pool_put (im->tunnel_interfaces, t);
}
+
+ if (sw_if_index)
+ *sw_if_index = hi->sw_if_index;
+
return 0;
}