return NULL;
}
- if (vpt && (vpt->type != TMPL_TYPE_ATTR)) {
- cf_log_err_cs(cs, "MUST use attribute reference in 'foreach'");
+ if (vpt && (vpt->type != TMPL_TYPE_ATTR) && (vpt->type != TMPL_TYPE_LIST)) {
+ cf_log_err_cs(cs, "MUST use attribute or list reference in 'foreach'");
return NULL;
}
* the attribute. In a perfect consistent world, users would do
* foreach &attr[*], but that's taking the consistency thing a bit far.
*/
- if (vpt && (vpt->type == TMPL_TYPE_ATTR)) {
- vpt->tmpl_num = NUM_ALL;
- }
+ vpt->tmpl_num = NUM_ALL;
csingle = do_compile_modgroup(parent, component, cs,
GROUPTYPE_SIMPLE, GROUPTYPE_SIMPLE,
if (slen < 0) goto parse_error;
check_children:
- rad_assert(g->vpt->type == TMPL_TYPE_ATTR);
+ rad_assert((g->vpt->type == TMPL_TYPE_ATTR) || (g->vpt->type == TMPL_TYPE_LIST));
if (g->vpt->tmpl_num != NUM_ALL) {
cf_log_err_cs(g->cs, "MUST NOT use instance selectors in 'foreach'");
return false;
--- /dev/null
+#
+# Input packet
+#
+User-Name = "bob"
+User-Password = "hello"
+Filter-Id = "1"
+Filter-Id += "2"
+Filter-Id += "3"
+Filter-Id += "4"
+
+#
+# Expected answer
+#
+Response-Packet-Type == Access-Accept
+Called-Station-Id == 'bob'
+Called-Station-Id == 'hello'
+Called-Station-Id == '1'
+Called-Station-Id == '2'
+Called-Station-Id == '3'
+Called-Station-Id == '4'
+