Skip to content

Commit

Permalink
correct checks in dict_attr_allow_dup()
Browse files Browse the repository at this point in the history
so that it actually checks for dups.
  • Loading branch information
alandekok committed Jan 10, 2025
1 parent efcd01f commit 7ff9e19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/util/dict_tokenize.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,11 +894,13 @@ static int dict_attr_allow_dup(fr_dict_attr_t const *da)
*/
if (!da->parent) return 1; /* no parent no conflicts possible */

dup_name = fr_dict_attr_by_name(NULL, da->parent, da->name);
if (da->flags.name_only) dup_num = fr_dict_attr_child_by_num(da->parent, da->attr);

/*
* Not a duplicate...
*/
if (!(dup_name = fr_dict_attr_by_name(NULL, da->parent, da->name)) &&
(da->flags.name_only || !(dup_num = fr_dict_attr_child_by_num(da->parent, da->attr)))) return 1;
if (!dup_name || dup_num) return 1;

found = dup_name ? dup_name : dup_num;

Expand Down

0 comments on commit 7ff9e19

Please sign in to comment.