]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Recurse into "if (1)" too, for pass2 compilations
authorAlan T. DeKok <aland@freeradius.org>
Mon, 5 Jan 2015 04:38:21 +0000 (23:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 5 Jan 2015 04:38:55 +0000 (23:38 -0500)
src/main/modcall.c

index 4445a58f11ceb5d942ff47d29ecc3ad84294adf4..ee0b32e4532de4d3a8485b850e0aed32a277d008 100644 (file)
@@ -480,6 +480,8 @@ redo:
 
                RDEBUG2("%s %s{", group_name[c->type], c->name);
 
+               RDEBUG("PASS2? %s", g->done_pass2 ? "yes" : "NO");
+
                condition = radius_evaluate_cond(request, result, 0, g->cond);
                if (condition < 0) {
                        condition = false;
@@ -3387,22 +3389,18 @@ bool modcall_pass2(modcallable *mc)
                        name2 = cf_section_name2(g->cs);
                        c->debug_name = talloc_asprintf(c, "%s %s", group_name[c->type], name2);
 
-                       /*
-                        *      Don't walk over these.
-                        */
-                       if ((g->cond->type == COND_TYPE_TRUE) ||
-                           (g->cond->type == COND_TYPE_FALSE)) {
-                               break;
-                       }
-
                        /*
                         *      The compilation code takes care of
                         *      simplifying 'true' and 'false'
                         *      conditions.  For others, we have to do
-                        *      a second pass to parse && compile xlats.
+                        *      a second pass to parse && compile
+                        *      xlats.
                         */
-                       if (!fr_condition_walk(g->cond, pass2_callback, NULL)) {
-                               return false;
+                       if (!((g->cond->type == COND_TYPE_TRUE) ||
+                             (g->cond->type == COND_TYPE_FALSE))) {
+                               if (!fr_condition_walk(g->cond, pass2_callback, NULL)) {
+                                       return false;
+                               }
                        }
 
                        if (!modcall_pass2(g->children)) return false;