Invoking the API session_rule_add_del to add a rule causes VPP to crash
if session is not enable.
Type: fix
Change-Id: If8de83f1064bc60d20461e87889b7c3393ad2af1
Signed-off-by: Steven Luong <[email protected]>
session_rule_table_add_del_args_t *table_args = &args.table_args;
int rv = 0;
+ if (session_main_is_enabled () == 0)
+ {
+ rv = VNET_API_ERROR_FEATURE_DISABLED;
+ goto done;
+ }
+
clib_memset (&args, 0, sizeof (args));
ip_prefix_decode (&mp->lcl, &table_args->lcl);
rv = VNET_API_ERROR_UNSPECIFIED;
}
vec_free (table_args->tag);
+done:
REPLY_MACRO (VL_API_SESSION_RULE_ADD_DEL_REPLY);
}