]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow n-ary operations for time delta, too
authorAlan T. DeKok <aland@freeradius.org>
Thu, 5 Oct 2023 18:48:39 +0000 (14:48 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 5 Oct 2023 19:20:19 +0000 (15:20 -0400)
src/lib/util/calc.c

index a5104091f7e9536fdb2226c74ee4885bc1794ff9..1fc1673fee10b6e90be3540ad084b80819cab45a 100644 (file)
@@ -2190,6 +2190,11 @@ int fr_value_calc_nary_op(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t type,
                calc = calc_int64;
                break;
 
+       case FR_TYPE_TIME_DELTA:
+               if ((op != T_ADD) && (op != T_SUB)) goto invalid_type;
+               calc = calc_time_delta;
+               break;
+
        case FR_TYPE_FLOAT32:
                calc = calc_float32;
                break;