}
}
- /* Check if SA is for IPv6/AH which is not supported. Return error if TRUE. */
- if (p.sa_id)
- {
- uword *p1;
- ipsec_main_t *im = &ipsec_main;
- ipsec_sa_t *sa = 0;
- p1 = hash_get (im->sa_index_by_sa_id, p.sa_id);
- if (!p1)
- {
- error =
- clib_error_return (0, "SA with index %u not found", p.sa_id);
- goto done;
- }
- sa = pool_elt_at_index (im->sad, p1[0]);
- if (sa && sa->protocol == IPSEC_PROTOCOL_AH && is_add && p.is_ipv6)
- {
- error = clib_error_return (0, "AH not supported for IPV6: '%U'",
- format_unformat_error, line_input);
- goto done;
- }
- }
-
rv = ipsec_policy_mk_type (is_outbound, p.is_ipv6, p.policy, &p.type);
if (rv)
vlib_cli_command_t * cmd)
{
unformat_input_t _line_input, *line_input = &_line_input;
+ ipsec_key_t ck = { }, ik =
+ {
+ };
clib_error_t *error = NULL;
- ipsec_key_t ck, ik;
u32 id;
if (!unformat_user (input, unformat_line_input, line_input))
unformat_input_t * input,
vlib_cli_command_t * cmd)
{
- u32 backend_index;
+ unformat_input_t _line_input, *line_input = &_line_input;
ipsec_main_t *im = &ipsec_main;
+ clib_error_t *error;
+ u32 backend_index;
- if (pool_elts (im->sad) > 0)
- {
- return clib_error_return (0,
- "Cannot change IPsec backend, while %u SA entries are configured",
- pool_elts (im->sad));
- }
+ error = ipsec_rsc_in_use (im);
+
+ if (error)
+ return error;
- unformat_input_t _line_input, *line_input = &_line_input;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
;
else
if (unformat
- (line_input, "rmote-integ-key %U", unformat_ipsec_key, &rik))
+ (line_input, "remote-integ-key %U", unformat_ipsec_key, &rik))
;
else if (unformat (line_input, "integ-alg %U",
unformat_ipsec_integ_alg, &a.integ_alg))