else if (!strcasecmp(value, "reject"))
action = MOD_ACTION_REJECT;
+ else if (!strcasecmp(value, "retry"))
+ action = MOD_ACTION_RETRY;
+
else if (strspn(value, "0123456789")==strlen(value)) {
action = atoi(value);
bool unlang_compile_actions(unlang_actions_t *actions, CONF_SECTION *action_cs)
{
+ int i;
CONF_ITEM *csi;
CONF_SECTION *cs;
}
}
+ /*
+ * Sanity check that "fail = retry", we actually have a
+ * retry section.
+ */
+ for (i = 0; i < RLM_MODULE_NUMCODES; i++) {
+ if (actions->actions[i] != MOD_ACTION_RETRY) continue;
+
+ if (!actions->retry.irt) {
+ cf_log_err(csi, "Cannot use a '%s = retry' action without a 'retry { ... }' section.",
+ fr_table_str_by_value(mod_rcode_table, i, "???"));
+ return false;
+ }
+ }
+
return true;
}
* to cause an immediate reject. */
#define MOD_ACTION_RETURN (-1)
#define MOD_ACTION_REJECT (-2)
+#define MOD_ACTION_RETRY (-3)
#define MOD_PRIORITY_MAX (64)
/** Types of unlang_t nodes