diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index d215cde02bdc..b777ed29034a 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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; }