From: Alan T. DeKok Date: Wed, 24 Mar 2021 15:02:48 +0000 (-0400) Subject: set internal flags based on attribute number X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7849b135ad4cb3fa45729b49412bfbec1efc221f;p=thirdparty%2Ffreeradius-server.git set internal flags based on attribute number not on recommended attribute numbers from 15 years ago --- diff --git a/src/lib/util/dict_validate.c b/src/lib/util/dict_validate.c index 4a31f656b73..bc698394e55 100644 --- a/src/lib/util/dict_validate.c +++ b/src/lib/util/dict_validate.c @@ -620,14 +620,13 @@ bool dict_attr_fields_valid(fr_dict_t *dict, fr_dict_attr_t const *parent, } /* - * Auto-set internal flags for raddb/dictionary. - * So that the end user doesn't have to know - * about internal implementation of the server. + * If the attribute is outside of the bounds of + * the type size, then it MUST be an internal + * attribute. Set the flag in this attribute, so + * that the encoder doesn't have to do complex + * checks. */ - if ((parent->flags.type_size == 1) && - (*attr >= 3000) && (*attr < 4000)) { - flags->internal = true; - } + if (*attr >= (1 << (8 * parent->flags.type_size))) flags->internal = true; } /*