Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ipsec: infra for selecting backends
[vpp.git]
/
src
/
vnet
/
ipsec
/
ipsec_if.c
diff --git
a/src/vnet/ipsec/ipsec_if.c
b/src/vnet/ipsec/ipsec_if.c
index
b8cba14
..
2e0dae0
100644
(file)
--- a/
src/vnet/ipsec/ipsec_if.c
+++ b/
src/vnet/ipsec/ipsec_if.c
@@
-170,33
+170,25
@@
ipsec_admin_up_down_function (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
{
if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
{
- ASSERT (im->cb.check_support_cb);
-
sa = pool_elt_at_index (im->sad, t->input_sa_index);
sa = pool_elt_at_index (im->sad, t->input_sa_index);
- err = i
m->cb.check_support_cb (
sa);
+ err = i
psec_check_support_cb (im,
sa);
if (err)
return err;
if (err)
return err;
- if (im->cb.add_del_sa_sess_cb)
- {
- err = im->cb.add_del_sa_sess_cb (t->input_sa_index, 1);
- if (err)
- return err;
- }
+ err = ipsec_add_del_sa_sess_cb (im, t->input_sa_index, 1);
+ if (err)
+ return err;
sa = pool_elt_at_index (im->sad, t->output_sa_index);
sa = pool_elt_at_index (im->sad, t->output_sa_index);
- err = i
m->cb.check_support_cb (
sa);
+ err = i
psec_check_support_cb (im,
sa);
if (err)
return err;
if (err)
return err;
- if (im->cb.add_del_sa_sess_cb)
- {
- err = im->cb.add_del_sa_sess_cb (t->output_sa_index, 1);
- if (err)
- return err;
- }
+ err = ipsec_add_del_sa_sess_cb (im, t->output_sa_index, 1);
+ if (err)
+ return err;
vnet_hw_interface_set_flags (vnm, hw_if_index,
VNET_HW_INTERFACE_FLAG_LINK_UP);
vnet_hw_interface_set_flags (vnm, hw_if_index,
VNET_HW_INTERFACE_FLAG_LINK_UP);
@@
-204,24
+196,14
@@
ipsec_admin_up_down_function (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
else
{
vnet_hw_interface_set_flags (vnm, hw_if_index, 0 /* down */ );
else
{
vnet_hw_interface_set_flags (vnm, hw_if_index, 0 /* down */ );
-
sa = pool_elt_at_index (im->sad, t->input_sa_index);
sa = pool_elt_at_index (im->sad, t->input_sa_index);
-
- if (im->cb.add_del_sa_sess_cb)
- {
- err = im->cb.add_del_sa_sess_cb (t->input_sa_index, 0);
- if (err)
- return err;
- }
-
+ err = ipsec_add_del_sa_sess_cb (im, t->input_sa_index, 0);
+ if (err)
+ return err;
sa = pool_elt_at_index (im->sad, t->output_sa_index);
sa = pool_elt_at_index (im->sad, t->output_sa_index);
-
- if (im->cb.add_del_sa_sess_cb)
- {
- err = im->cb.add_del_sa_sess_cb (t->output_sa_index, 0);
- if (err)
- return err;
- }
+ err = ipsec_add_del_sa_sess_cb (im, t->output_sa_index, 0);
+ if (err)
+ return err;
}
return /* no error */ 0;
}
return /* no error */ 0;
@@
-596,15
+578,11
@@
ipsec_set_interface_sa (vnet_main_t * vnm, u32 hw_if_index, u32 sa_id,
if (ipsec_get_sa_index_by_sa_id (old_sa->id) == old_sa_index)
hash_unset (im->sa_index_by_sa_id, old_sa->id);
if (ipsec_get_sa_index_by_sa_id (old_sa->id) == old_sa_index)
hash_unset (im->sa_index_by_sa_id, old_sa->id);
- if (
im->cb.add_del_sa_sess_cb
)
+ if (
!ipsec_add_del_sa_sess_cb (im, old_sa_index, 0)
)
{
{
- clib_error_t *err;
-
- err = im->cb.add_del_sa_sess_cb (old_sa_index, 0);
- if (err)
- return VNET_API_ERROR_SYSCALL_ERROR_1;
+ clib_warning ("IPsec backend add/del callback returned error");
+ return VNET_API_ERROR_SYSCALL_ERROR_1;
}
}
-
pool_put (im->sad, old_sa);
return 0;
pool_put (im->sad, old_sa);
return 0;