/*
* If the caller is asking for a namespace, then walk back up the tmpl_rules_t to find a parent namespace.
*/
- if (namespace && (ref == REQUEST_PARENT) && t_rules->parent) {
+ if (namespace && t_rules->parent) {
t_rules = t_rules->parent;
- if (t_rules->attr.namespace) {
- *namespace = t_rules->attr.namespace;
- } else if (t_rules->attr.dict_def) {
- *namespace = fr_dict_root(t_rules->attr.dict_def);
+ switch (ref) {
+ case REQUEST_OUTER:
+ while (t_rules->parent) t_rules = t_rules->parent; /* Walk back to the root */
+ FALL_THROUGH;
- } else {
- *namespace = NULL;
+ case REQUEST_PARENT:
+ if (t_rules->attr.namespace) {
+ *namespace = t_rules->attr.namespace;
+ } else if (t_rules->attr.dict_def) {
+ *namespace = fr_dict_root(t_rules->attr.dict_def);
+
+ } else {
+ *namespace = NULL;
+ }
+ break;
+
+ default:
+ break;
}
}
ssize_t slen;
tmpl_rules_t t_rules = (tmpl_rules_t) {
+ .parent = unlang_ctx->rules->parent,
.attr = {
.dict_def = xr_rules.tr_rules->dict_def,
.list_def = request_attr_request,
caller dhcpv4 {
&parent.Gateway-IP-Address = 127.0.0.1
&parent.control.Your-IP-Address = 127.0.0.2
+ &outer.control.Framed-IP-Address = 127.0.0.3
cache_not_radius
if (!ok) {
if (!updated) {
reject
}
+
+ if (!&parent.Your-IP-Address) {
+ reject
+ }
+
+ if (!&outer.Framed-IP-Address) {
+ reject
+ }
}
}
}