goto exit;
}
- if (options.loopprevention && !strcmp(from->conf->name, to->conf->name)) {
+ if ((to->conf->loopprevention == 1
+ || (to->conf->loopprevention == UCHAR_MAX && options.loopprevention == 1))
+ && !strcmp(from->conf->name, to->conf->name)) {
debug(DBG_INFO, "radsrv: Loop prevented, not forwarding request from client %s (%s) to server %s, discarding",
from->conf->name, addr2string(from->addr), to->conf->name);
goto exit;
return 0;
}
memset(conf, 0, sizeof(struct clsrvconf));
+ conf->loopprevention = UCHAR_MAX; /* Uninitialized. */
resconf = (struct clsrvconf *)arg;
if (resconf) {
conf->statusserver = resconf->statusserver;
"RetryInterval", CONF_LINT, &retryinterval,
"RetryCount", CONF_LINT, &retrycount,
"DynamicLookupCommand", CONF_STR, &conf->dynamiclookupcommand,
+ "LoopPrevention", CONF_BLN, &conf->loopprevention,
NULL
)) {
debug(DBG_ERR, "configuration error");
uint8_t dupinterval;
uint8_t certnamecheck;
uint8_t addttl;
+ uint8_t loopprevention;
struct rewrite *rewritein;
struct rewrite *rewriteout;
pthread_mutex_t *lock; /* only used for updating clients so far */