From: Alan T. DeKok Date: Mon, 26 Sep 2022 16:24:42 +0000 (-0400) Subject: time_delta can be counter, too X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c293f4997e6b64747cef53c1d4104d0816240a2a;p=thirdparty%2Ffreeradius-server.git time_delta can be counter, too --- diff --git a/src/lib/util/dict_validate.c b/src/lib/util/dict_validate.c index 5bce1214ccc..23f5e999f12 100644 --- a/src/lib/util/dict_validate.c +++ b/src/lib/util/dict_validate.c @@ -489,10 +489,12 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent, } /* - * Only numerical types can be counter + * Counters can be time deltas, or unsigned integers. + * For other data types, we don't know how to + * automatically add two counters. */ if (flags->is_counter) { - if (fr_type_is_numeric(type) && !fr_type_is_signed(type)) { + if ((type == FR_TYPE_TIME_DELTA) || (fr_type_is_integer(type) && !fr_type_is_signed(type))) { ALLOW_FLAG(is_counter); } else { fr_strerror_printf("The 'counter' flag cannot be used with '%s'", fr_type_to_str(type));