Skip to content

Commit

Permalink
Search protocol flags first
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Oct 29, 2024
1 parent 38a26bd commit 0d0524c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/util/dict_tokenize.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,13 @@ static int dict_process_flag_field(dict_tokenize_ctx_t *ctx, char *name, fr_dict
}

/*
* Search in the main flags table
* then the protocol flags table.
* Search the protocol table, then the main table.
* This allows protocols to overload common flags.
*/
if (!fr_dict_attr_flag_to_parser(&parser, dict_common_flags, dict_common_flags_len, key, NULL) &&
(!ctx->dict->proto->attr.flags.table ||
!fr_dict_attr_flag_to_parser(&parser, ctx->dict->proto->attr.flags.table,
ctx->dict->proto->attr.flags.table_len, key, NULL))) {
if (!((ctx->dict->proto->attr.flags.table &&
fr_dict_attr_flag_to_parser(&parser, ctx->dict->proto->attr.flags.table,
ctx->dict->proto->attr.flags.table_len, key, NULL)) ||
fr_dict_attr_flag_to_parser(&parser, dict_common_flags, dict_common_flags_len, key, NULL))) {
fr_strerror_printf("Unknown flag '%s'", key);
return -1;
}
Expand Down

0 comments on commit 0d0524c

Please sign in to comment.