]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't re-define known attributes
authorAlan T. DeKok <aland@freeradius.org>
Thu, 19 Jan 2017 22:31:31 +0000 (17:31 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 19 Jan 2017 22:31:31 +0000 (17:31 -0500)
src/lib/dict.c

index 1be204bad60c33ee4e90b00594bd5862a5bdf3c5..f55d6626b5764df067853b03d9812275ef7b2c4e 100644 (file)
@@ -2787,6 +2787,12 @@ fr_dict_attr_t const *fr_dict_unknown_add(fr_dict_t *dict, fr_dict_attr_t const
         */
        if (old->type == PW_TYPE_VENDOR) if (fr_dict_vendor_add(dict, old->name, old->attr) < 0) return NULL;
 
+       /*
+        *      Look up the attribute.  If it's already defined, don't re-define it.
+        */
+       da = fr_dict_attr_child_by_num(parent, old->attr);
+       if (da) return old;
+
        if (fr_dict_attr_add(dict, old->parent, old->name, old->attr, old->type, flags) < 0) return NULL;
 
        da = fr_dict_attr_child_by_num(parent, old->attr);