From: Alan T. DeKok Date: Mon, 29 Mar 2021 19:06:25 +0000 (-0400) Subject: no need to call cond_eval_map() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f845cd7b472e85ba4e8d9a23e4db4157c1ff674c;p=thirdparty%2Ffreeradius-server.git no need to call cond_eval_map() --- diff --git a/src/lib/server/cond_tokenize.c b/src/lib/server/cond_tokenize.c index ad7b7092106..6f5e19818dd 100644 --- a/src/lib/server/cond_tokenize.c +++ b/src/lib/server/cond_tokenize.c @@ -658,15 +658,19 @@ static int cond_normalise(TALLOC_CTX *ctx, fr_token_t lhs_type, fr_cond_t **c_ou tmpl_is_data(c->data.map->rhs)) { int rcode; - rcode = cond_eval_map(NULL, 0, c); + fr_assert(c->next == NULL); + + rcode = cond_eval(NULL, RLM_MODULE_NOOP, c); + fr_assert(rcode >= 0); TALLOC_FREE(c->data.map); - if (rcode) { + if (rcode > 0) { c->type = COND_TYPE_TRUE; } else { c->type = COND_TYPE_FALSE; } + c->negate = false; goto check_true; /* it's no longer a map */ } diff --git a/src/lib/unlang/switch.c b/src/lib/unlang/switch.c index de731dfdfc5..0327a1d3cfa 100644 --- a/src/lib/unlang/switch.c +++ b/src/lib/unlang/switch.c @@ -147,7 +147,7 @@ static unlang_action_t unlang_switch(rlm_rcode_t *p_result, request_t *request, * * Note that we don't need to do any casting of the RHS */ - if (cond_eval_map(request, 0, &cond) == 1) { + if (cond_eval(request, RLM_MODULE_NOOP, &cond) == 1) { found = this; break; }