From: Alan T. DeKok Date: Thu, 18 Nov 2021 19:24:22 +0000 (-0500) Subject: more checks and add calc_integer_size X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c356c2e74ffa2ccf93b70c816db77df0625e2a9;p=thirdparty%2Ffreeradius-server.git more checks and add calc_integer_size --- diff --git a/src/lib/util/calc.c b/src/lib/util/calc.c index 374c6371749..288618d795a 100644 --- a/src/lib/util/calc.c +++ b/src/lib/util/calc.c @@ -711,6 +711,8 @@ CALC(uint16) CALC(uint32) CALC(uint64) +CALC(size) + CALC(int8) CALC(int16) CALC(int32) @@ -724,11 +726,12 @@ static const fr_binary_op_t calc_integer_type[FR_TYPE_MAX + 1] = { [FR_TYPE_UINT32] = calc_uint32, [FR_TYPE_UINT64] = calc_uint64, + [FR_TYPE_SIZE] = calc_size, + [FR_TYPE_INT8] = calc_int8, [FR_TYPE_INT16] = calc_int16, [FR_TYPE_INT32] = calc_int32, [FR_TYPE_INT64] = calc_int64, - }; static int calc_integer(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) @@ -744,6 +747,8 @@ static int calc_integer(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t con */ if ((dst->type == in1->type) && (dst->type == in2->type)) { + if (!calc_integer_type[dst->type]) goto not_yet; + return calc_integer_type[dst->type](ctx, dst, in1, op, in2); } @@ -777,6 +782,7 @@ static int calc_integer(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t con } if (!calc_integer_type[type]) { + not_yet: fr_strerror_const("Not yet implemented"); return -1; }