]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Look up unknown attributes by name, not by number.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 20 Jan 2017 17:48:01 +0000 (12:48 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 20 Jan 2017 18:18:52 +0000 (13:18 -0500)
And update the ipaddr.raw test to match.

next, update the tests for attribute existence...

src/main/tmpl.c
src/tests/keywords/ipaddr.raw

index ec1417d09b229b45499b06772c86528334b8c3f9..0bf5b62d7d193317d5ecd8739ba1eb59ef7aea6e 100644 (file)
@@ -749,8 +749,7 @@ ssize_t tmpl_from_attr_substr(vp_tmpl_t *vpt, char const *name,
                         *      If it has, parsing is the same as if the attribute
                         *      name had been used instead of its OID.
                         */
-                       attr.da = fr_dict_attr_child_by_num(((fr_dict_attr_t *)&attr.unknown.da)->parent,
-                                                           ((fr_dict_attr_t *)&attr.unknown.da)->attr);
+                       attr.da = fr_dict_attr_by_name(NULL, a);
                        if (attr.da) {
                                vpt->auto_converted = true;
                                goto do_num;
index aa990eb059d6ad8028911d72e65afa6fed981cb2..87372769d90edc1697c27654a385416387235019 100644 (file)
@@ -12,3 +12,22 @@ update control {
 update request {
        Attr-4 = 0x010203
 }
+
+#if (!&Attr-4) {
+if (0) {
+       update reply {
+               Filter-Id := "Cannot find newly added raw attribute"
+       }
+}
+else {
+       if (&Attr-4 != 0x010203) {
+               update reply {
+                       Filter-Id := "Attr-4 is not 0x0120203"
+               }
+       }
+       else {
+               update reply {
+                       Filter-Id := "filter"
+               }
+       }
+}
\ No newline at end of file